From f7728db8fe471c57f62c71eefc0aa1731c393fcd Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Feb 2019 19:38:17 +0900 Subject: [PATCH] [Client] Fix bug --- src/client/app/admin/views/users.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue index 8aab0b54f..d46c72cbe 100644 --- a/src/client/app/admin/views/users.vue +++ b/src/client/app/admin/views/users.vue @@ -129,16 +129,25 @@ export default Vue.extend({ const usernamePromise = this.$root.api('users/show', parseAcct(this.target)); const idPromise = this.$root.api('users/show', { userId: this.target }); - usernamePromise.then(res); - idPromise.then(res); - - idPromise.catch(e => { - if (e == 'user not found') { + let _notFound = false; + const notFound = () => { + if (_notFound) { this.$root.dialog({ type: 'error', 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(); }); }); },