From 2e6a83c48177a254c46612cfe605de401b58da75 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Nov 2020 12:40:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=83=94?= =?UTF-8?q?=E3=83=83=E3=82=AB=E3=83=BC=E3=81=AB=E6=9C=80=E8=BF=91=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=81=97=E3=81=9F=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/user-select-dialog.vue | 36 ++++++++++++++++++-- src/client/store.ts | 1 + 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/client/components/user-select-dialog.vue b/src/client/components/user-select-dialog.vue index e7bfcafbb..cdb899005 100644 --- a/src/client/components/user-select-dialog.vue +++ b/src/client/components/user-select-dialog.vue @@ -14,10 +14,10 @@ {{ $t('host') }} -
+
- +
@@ -28,6 +28,17 @@ {{ $t('noUsers') }}
+
+
+
+ +
+ + +
+
+
+
@@ -53,18 +64,23 @@ export default defineComponent({ return { username: '', host: '', + recentUsers: [], users: [], selected: null, faTimes, faCheck }; }, - mounted() { + async mounted() { this.focus(); this.$nextTick(() => { this.focus(); }); + + this.recentUsers = await os.api('users/show', { + userIds: this.$store.state.device.recentlyUsedUsers + }); }, methods: { @@ -90,6 +106,12 @@ export default defineComponent({ ok() { this.$emit('ok', this.selected); this.$refs.dialog.close(); + + // 最近使ったユーザー更新 + let recents = this.$store.state.device.recentlyUsedUsers; + recents = recents.filter(x => x !== this.selected.id); + recents.unshift(this.selected.id); + this.$store.commit('device/set', { key: 'recentlyUsedUsers', value: recents.splice(0, 16) }); }, cancel() { @@ -107,6 +129,14 @@ export default defineComponent({ overflow: auto; height: 100%; + &.result.hit { + padding: 0; + } + + &.recent { + padding: 0; + } + > .inputs { > .input { display: inline-block; diff --git a/src/client/store.ts b/src/client/store.ts index 6dec9205b..952c5fef5 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -60,6 +60,7 @@ export const defaultDeviceSettings = { serverDisconnectedBehavior: 'quiet', accounts: [], recentlyUsedEmojis: [], + recentlyUsedUsers: [], themes: [], darkTheme: '8050783a-7f63-445a-b270-36d0f6ba1677', lightTheme: '4eea646f-7afa-4645-83e9-83af0333cd37',