clean up promises properly
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e8db379fed
commit
77dbc79386
1 changed files with 3 additions and 1 deletions
|
@ -45,7 +45,7 @@ const singleMxcUpload = async () => {
|
||||||
Modal.createTrackedDialog('Upload Files confirmation', '', UploadConfirmDialog, {
|
Modal.createTrackedDialog('Upload Files confirmation', '', UploadConfirmDialog, {
|
||||||
file,
|
file,
|
||||||
onFinished: (shouldContinue) => {
|
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) => {
|
return success(promise.then((url) => {
|
||||||
|
if (!url) return;
|
||||||
const ev = room.currentState.getStateEvents('m.room.member', userId);
|
const ev = room.currentState.getStateEvents('m.room.member', userId);
|
||||||
const content = {
|
const content = {
|
||||||
...ev ? ev.getContent() : { membership: 'join' },
|
...ev ? ev.getContent() : { membership: 'join' },
|
||||||
|
@ -267,6 +268,7 @@ export const CommandMap = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return success(promise.then((url) => {
|
return success(promise.then((url) => {
|
||||||
|
if (!url) return;
|
||||||
return MatrixClientPeg.get().setAvatarUrl(url);
|
return MatrixClientPeg.get().setAvatarUrl(url);
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue