From 0d02dd06deb3dda38d836e154b6f8e56339d3122 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 20 Sep 2020 12:02:39 +0900 Subject: [PATCH] wip --- src/client/components/autocomplete.vue | 5 +---- src/client/components/post-form.vue | 11 ++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue index dc539911d9..fce6500d29 100644 --- a/src/client/components/autocomplete.vue +++ b/src/client/components/autocomplete.vue @@ -378,11 +378,8 @@ export default defineComponent({ chooseUser() { this.close(); - const vm = os.modal(MkUserSelect, {}); - vm.$once('selected', user => { + os.modal(MkUserSelect, {}).then(user => { this.complete('user', user); - }); - vm.$once('closed', () => { this.textarea.focus(); }); }, diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index 7e742e79cb..cade01efab 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -424,12 +424,11 @@ export default defineComponent({ // TODO: information dialog return; } - const w = os.modal(MkVisibilityChooser, { + os.modal(MkVisibilityChooser, { source: this.$refs.visibilityButton, currentVisibility: this.visibility, currentLocalOnly: this.localOnly - }); - w.$once('chosen', ({ visibility, localOnly }) => { + }).then(({ visibility, localOnly }) => { this.applyVisibility(visibility); this.localOnly = localOnly; }); @@ -440,8 +439,7 @@ export default defineComponent({ }, addVisibleUser() { - const vm = os.modal(MkUserSelect, {}); - vm.$once('selected', user => { + os.modal(MkUserSelect, {}).then(user => { this.visibleUsers.push(user); }); }, @@ -604,8 +602,7 @@ export default defineComponent({ }, insertMention() { - const vm = os.modal(MkUserSelect, {}); - vm.$once('selected', user => { + os.modal(MkUserSelect, {}).then(user => { insertTextAtCursor(this.$refs.text, getAcct(user) + ' '); }); },