You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
clean up promises properly
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -45,7 +45,7 @@ const singleMxcUpload = async () => {
|
||||
Modal.createTrackedDialog('Upload Files confirmation', '', UploadConfirmDialog, {
|
||||
file,
|
||||
onFinished: (shouldContinue) => {
|
||||
if (shouldContinue) resolve(MatrixClientPeg.get().uploadContent(file));
|
||||
resolve(shouldContinue ? MatrixClientPeg.get().uploadContent(file) : null);
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -246,6 +246,7 @@ export const CommandMap = {
|
||||
}
|
||||
|
||||
return success(promise.then((url) => {
|
||||
if (!url) return;
|
||||
const ev = room.currentState.getStateEvents('m.room.member', userId);
|
||||
const content = {
|
||||
...ev ? ev.getContent() : { membership: 'join' },
|
||||
@@ -267,6 +268,7 @@ export const CommandMap = {
|
||||
}
|
||||
|
||||
return success(promise.then((url) => {
|
||||
if (!url) return;
|
||||
return MatrixClientPeg.get().setAvatarUrl(url);
|
||||
}));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user