mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 13:25:44 +01:00
[Client] Fix bug
This commit is contained in:
parent
62d17c9266
commit
962b3ca78e
1 changed files with 14 additions and 5 deletions
|
@ -129,16 +129,25 @@ export default Vue.extend({
|
||||||
const usernamePromise = this.$root.api('users/show', parseAcct(this.target));
|
const usernamePromise = this.$root.api('users/show', parseAcct(this.target));
|
||||||
const idPromise = this.$root.api('users/show', { userId: this.target });
|
const idPromise = this.$root.api('users/show', { userId: this.target });
|
||||||
|
|
||||||
usernamePromise.then(res);
|
let _notFound = false;
|
||||||
idPromise.then(res);
|
const notFound = () => {
|
||||||
|
if (_notFound) {
|
||||||
idPromise.catch(e => {
|
|
||||||
if (e == 'user not found') {
|
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
text: this.$t('user-not-found')
|
text: this.$t('user-not-found')
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
_notFound = true;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
usernamePromise.then(res).catch(e => {
|
||||||
|
if (e == 'user not found') {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
idPromise.then(res).catch(e => {
|
||||||
|
notFound();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue