From eab0a7d0182665bdb93042141d23ce49fe0e46a7 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Mon, 15 Jan 2024 23:17:02 +0900 Subject: [PATCH] Feat: emoji picker profile --- packages/frontend/src/pages/settings/emoji-picker.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/pages/settings/emoji-picker.vue b/packages/frontend/src/pages/settings/emoji-picker.vue index 07c6e2c61d..139de97c7a 100644 --- a/packages/frontend/src/pages/settings/emoji-picker.vue +++ b/packages/frontend/src/pages/settings/emoji-picker.vue @@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- + @@ -170,6 +170,9 @@ const nowProfileId = ref(defaultStore.state.pickerProfileDefault); const $i = signinRequired(); const profileMax = $i.policies.emojiPickerProfileLimit; const profileName = ref(defaultStore.state[`pickerProfileName${nowProfileId.value > 1 ? nowProfileId.value - 1 : ''}`]); +const nowDefaultProfileId = ref(defaultStore.state['pickerProfileDefault']); +const nowDefaultProfileName = ref(); +nowDefaultProfileName.value = deepClone(defaultStore.state[`pickerProfileName${nowDefaultProfileId.value > 1 ? nowDefaultProfileId.value - 1 : ''}`]); pinnedEmojisForReaction.value = deepClone(defaultStore.state[`reactions${nowProfileId.value > 1 ? nowProfileId.value - 1 : ''}`]); pinnedEmojis.value = deepClone(defaultStore.state[`pinnedEmojis${nowProfileId.value > 1 ? nowProfileId.value - 1 : ''}`]); profileName.value = deepClone(defaultStore.state[`pickerProfileName${nowProfileId.value > 1 ? nowProfileId.value - 1 : ''}`]); @@ -273,6 +276,8 @@ async function setDefaultProfile() { text: i18n.ts.setDefaultProfileConfirm, }); if (canceled) return; + nowDefaultProfileId.value = nowProfileId.value; + nowDefaultProfileName.value = deepClone(defaultStore.state[`pickerProfileName${nowProfileId.value > 1 ? nowProfileId.value - 1 : ''}`]); await defaultStore.set('pickerProfileDefault', nowProfileId.value); }