summaryrefslogtreecommitdiff
path: root/src/client/app/admin/views
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-03 05:06:23 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-03 05:06:23 +0900
commit3441acf56cefe4d82c3f67cdde55c6f9e71c6b52 (patch)
treefb9dee5cbd6352c8e5e0cf56f3f81950956377b3 /src/client/app/admin/views
parentClose #4093 (diff)
downloadmisskey-3441acf56cefe4d82c3f67cdde55c6f9e71c6b52.tar.gz
misskey-3441acf56cefe4d82c3f67cdde55c6f9e71c6b52.tar.bz2
misskey-3441acf56cefe4d82c3f67cdde55c6f9e71c6b52.zip
Improve usability
Diffstat (limited to 'src/client/app/admin/views')
-rw-r--r--src/client/app/admin/views/users.vue33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue
index a9544f81e2..8aab0b54f0 100644
--- a/src/client/app/admin/views/users.vue
+++ b/src/client/app/admin/views/users.vue
@@ -124,22 +124,23 @@ export default Vue.extend({
methods: {
/** テキストエリアのユーザーを解決する */
- async fetchUser() {
- try {
- return await this.$root.api('users/show', this.target.startsWith('@') ? parseAcct(this.target) : { userId: this.target });
- } catch (e) {
- if (e == 'user not found') {
- this.$root.dialog({
- type: 'error',
- text: this.$t('user-not-found')
- });
- } else {
- this.$root.dialog({
- type: 'error',
- text: e.toString()
- });
- }
- }
+ fetchUser() {
+ return new Promise((res) => {
+ 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') {
+ this.$root.dialog({
+ type: 'error',
+ text: this.$t('user-not-found')
+ });
+ }
+ });
+ });
},
/** テキストエリアから処理対象ユーザーを設定する */