1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Check error message for room publish failure

Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
This commit is contained in:
Andrew Ferrazzutti
2021-09-29 19:00:14 -04:00
parent cd8a0b8aec
commit 71851d8075

View File

@@ -222,7 +222,7 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
return client.createRoom(createOpts).finally(function() { return client.createRoom(createOpts).finally(function() {
if (modal) modal.close(); if (modal) modal.close();
}).catch(function(err) { }).catch(function(err) {
if (err.httpStatus === 403 && err.errcode == "M_UNKNOWN") { if (err.httpStatus === 403 && err.errcode === "M_UNKNOWN" && err.data.error === "Not allowed to publish room") {
console.warn("Failed to publish room, try again without publishing it"); console.warn("Failed to publish room, try again without publishing it");
createOpts.visibility = Visibility.Private; createOpts.visibility = Visibility.Private;
return client.createRoom(createOpts); return client.createRoom(createOpts);