@@ -35,6 +35,8 @@ export default defineComponent({
props: {
},
+ emits: ['done'],
+
data() {
return {
username: '',
@@ -73,13 +75,8 @@ export default defineComponent({
this.$refs.username.focus();
},
- close() {
- this.$refs.window.close();
- },
-
ok() {
- this.$emit('selected', this.selected);
- this.close();
+ this.$emit('done', this.selected);
},
}
});
diff --git a/src/client/os.ts b/src/client/os.ts
index 69094169a1..bc4d09b74a 100644
--- a/src/client/os.ts
+++ b/src/client/os.ts
@@ -143,9 +143,21 @@ export function dialog(props: Record, opts?: { cancelableByBgClick:
});
}
-export function selectDriveFile(multiple) {
- return new Promise(async (res, rej) => {
- modal(await import('@/components/drive-window.vue'), {
+export async function selectUser() {
+ const component = await import('@/components/user-select.vue');
+ return new Promise((res, rej) => {
+ modal(component, {}).then(user => {
+ if (user) {
+ res(user);
+ }
+ });
+ });
+}
+
+export async function selectDriveFile(multiple: boolean) {
+ const component = await import('@/components/drive-window.vue');
+ return new Promise((res, rej) => {
+ modal(component, {
type: 'file',
multiple
}).then(files => {
@@ -156,16 +168,16 @@ export function selectDriveFile(multiple) {
});
}
-export function selectDriveFolder(multiple) {
+export async function selectDriveFolder(multiple: boolean) {
+ const component = await import('@/components/drive-window.vue');
return new Promise((res, rej) => {
- import('@/components/drive-window.vue').then(dialog => {
- const w = $root.new(dialog, {
- type: 'folder',
- multiple
- });
- w.$once('selected', folders => {
- res(multiple ? folders : (folders.length === 0 ? null : folders[0]));
- });
+ modal(component, {
+ type: 'folder',
+ multiple
+ }).then(folders => {
+ if (folders) {
+ res(folders[0]);
+ }
});
});
}
diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue
index fd9ce3e790..30fc8b7ca1 100644
--- a/src/client/pages/instance/settings.vue
+++ b/src/client/pages/instance/settings.vue
@@ -242,7 +242,6 @@ import MkInput from '@/components/ui/input.vue';
import MkTextarea from '@/components/ui/textarea.vue';
import MkSwitch from '@/components/ui/switch.vue';
import MkInfo from '@/components/ui/info.vue';
-import MkUserSelect from '@/components/user-select.vue';
import { url } from '@/config';
import getAcct from '../../../misc/acct/render';
import * as os from '@/os';
@@ -452,8 +451,7 @@ export default defineComponent({
},
addPinUser() {
- os.modal(MkUserSelect, {}).then(user => {
- if (user == null) return;
+ os.selectUser().then(user => {
this.pinnedUsers = this.pinnedUsers.trim();
this.pinnedUsers += '\n@' + getAcct(user);
this.pinnedUsers = this.pinnedUsers.trim();
@@ -461,8 +459,7 @@ export default defineComponent({
},
chooseProxyAccount() {
- os.modal(MkUserSelect, {}).then(user => {
- if (user == null) return;
+ os.selectUser().then(user => {
this.proxyAccount = user;
this.proxyAccountId = user.id;
this.save(true);
diff --git a/src/client/pages/instance/users.vue b/src/client/pages/instance/users.vue
index 919627c0a3..e044b0d95f 100644
--- a/src/client/pages/instance/users.vue
+++ b/src/client/pages/instance/users.vue
@@ -43,10 +43,10 @@
-
+
{{ $t('username') }}
-
+
{{ $t('host') }}
@@ -90,7 +90,6 @@ import MkButton from '@/components/ui/button.vue';
import MkInput from '@/components/ui/input.vue';
import MkSelect from '@/components/ui/select.vue';
import MkPagination from '@/components/ui/pagination.vue';
-import MkUserSelect from '@/components/user-select.vue';
import { acct } from '../../filters/user';
import * as os from '@/os';
@@ -180,7 +179,7 @@ export default defineComponent({
},
searchUser() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
this.show(user);
});
},
diff --git a/src/client/pages/messaging/index.vue b/src/client/pages/messaging/index.vue
index a2cc0e36f7..7f23837fe6 100644
--- a/src/client/pages/messaging/index.vue
+++ b/src/client/pages/messaging/index.vue
@@ -42,7 +42,6 @@ import { defineComponent } from 'vue';
import { faUser, faUsers, faComments, faPlus } from '@fortawesome/free-solid-svg-icons';
import getAcct from '../../../misc/acct/render';
import MkButton from '@/components/ui/button.vue';
-import MkUserSelect from '@/components/user-select.vue';
import { acct } from '../../filters/user';
import * as os from '@/os';
@@ -132,7 +131,7 @@ export default defineComponent({
},
async startUser() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
this.$router.push(`/my/messaging/${getAcct(user)}`);
});
},
diff --git a/src/client/pages/my-antennas/index.antenna.vue b/src/client/pages/my-antennas/index.antenna.vue
index 52af31606d..13c709bf1c 100644
--- a/src/client/pages/my-antennas/index.antenna.vue
+++ b/src/client/pages/my-antennas/index.antenna.vue
@@ -53,7 +53,6 @@ import MkInput from '@/components/ui/input.vue';
import MkTextarea from '@/components/ui/textarea.vue';
import MkSelect from '@/components/ui/select.vue';
import MkSwitch from '@/components/ui/switch.vue';
-import MkUserSelect from '@/components/user-select.vue';
import getAcct from '../../../misc/acct/render';
import * as os from '@/os';
@@ -177,7 +176,7 @@ export default defineComponent({
},
addUser() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
this.users = this.users.trim();
this.users += '\n@' + getAcct(user);
this.users = this.users.trim();
diff --git a/src/client/pages/my-groups/group.vue b/src/client/pages/my-groups/group.vue
index e0edffa80d..01a30030dc 100644
--- a/src/client/pages/my-groups/group.vue
+++ b/src/client/pages/my-groups/group.vue
@@ -42,7 +42,6 @@ import { defineComponent } from 'vue';
import { faTimes, faUsers } from '@fortawesome/free-solid-svg-icons';
import Progress from '@/scripts/loading';
import MkButton from '@/components/ui/button.vue';
-import MkUserSelect from '@/components/user-select.vue';
import * as os from '@/os';
export default defineComponent({
@@ -89,7 +88,7 @@ export default defineComponent({
},
invite() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
os.api('users/groups/invite', {
groupId: this.group.id,
userId: user.id
@@ -134,7 +133,7 @@ export default defineComponent({
},
transfer() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
os.api('users/groups/transfer', {
groupId: this.group.id,
userId: user.id
diff --git a/src/client/pages/my-lists/list.vue b/src/client/pages/my-lists/list.vue
index 9185323c98..e9e93efa8b 100644
--- a/src/client/pages/my-lists/list.vue
+++ b/src/client/pages/my-lists/list.vue
@@ -41,7 +41,6 @@ import { defineComponent } from 'vue';
import { faTimes, faListUl } from '@fortawesome/free-solid-svg-icons';
import Progress from '@/scripts/loading';
import MkButton from '@/components/ui/button.vue';
-import MkUserSelect from '@/components/user-select.vue';
import * as os from '@/os';
export default defineComponent({
@@ -88,7 +87,7 @@ export default defineComponent({
},
addUser() {
- os.modal(MkUserSelect, {}).$once('selected', user => {
+ os.selectUser().then(user => {
os.api('users/lists/push', {
listId: this.list.id,
userId: user.id
diff --git a/src/client/pages/page-editor/page-editor.blocks.vue b/src/client/pages/page-editor/page-editor.blocks.vue
index 6b78f0846a..d99a82052d 100644
--- a/src/client/pages/page-editor/page-editor.blocks.vue
+++ b/src/client/pages/page-editor/page-editor.blocks.vue
@@ -1,6 +1,6 @@
- removeItem(block)" :key="block.id" :hpml="hpml"/>
+ removeItem(block)" :key="block.id" :hpml="hpml"/>
diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue
index e60cfe3b2a..ec9d75ace3 100644
--- a/src/client/pages/page-editor/page-editor.vue
+++ b/src/client/pages/page-editor/page-editor.vue
@@ -59,7 +59,7 @@
updateVariable(v)"
+ @update:value="v => updateVariable(v)"
@remove="() => removeVariable(variable)"
:key="variable.name"
:hpml="hpml"
diff --git a/src/client/pages/room/room.vue b/src/client/pages/room/room.vue
index 433d8c1276..4b42f29f0e 100644
--- a/src/client/pages/room/room.vue
+++ b/src/client/pages/room/room.vue
@@ -39,7 +39,7 @@
{{ $t('_rooms.addFurniture') }}