Merge pull request #4328 from matrix-org/t3chguy/slashcommands

fix /invite Slash Command
This commit is contained in:
Michael Telatynski 2020-04-01 17:02:47 +01:00 committed by GitHub
commit 138d280e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,17 +412,20 @@ export const Commands = [
button: _t("Continue"),
},
));
finished = finished.then(([useDefault]: any) => {
if (useDefault) {
useDefaultIdentityServer();
return;
}
throw new Error(_t("Use an identity server to invite by email. Manage in Settings."));
});
} else {
return reject(_t("Use an identity server to invite by email. Manage in Settings."));
}
}
const inviter = new MultiInviter(roomId);
return success(finished.then(([useDefault]: any) => {
if (useDefault) {
useDefaultIdentityServer();
} else if (useDefault === false) {
throw new Error(_t("Use an identity server to invite by email. Manage in Settings."));
}
return success(finished.then(() => {
return inviter.invite([address]);
}).then(() => {
if (inviter.getCompletionState(address) !== "invited") {