diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.js b/src/components/settings_modal/admin_tabs/emoji_tab.js index 6afd0be5c..78f71934b 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.js +++ b/src/components/settings_modal/admin_tabs/emoji_tab.js @@ -11,8 +11,8 @@ import ModifiedIndicator from '../helpers/modified_indicator.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import StringSetting from '../helpers/string_setting.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useEmojiStore } from 'src/stores/emoji.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface.js' import { library } from '@fortawesome/fontawesome-svg-core' @@ -176,21 +176,24 @@ const EmojiTab = { }, refreshPackList() { - useEmojiStore().getAdminPacks( - this.remotePackInstance, - this.$store.state.api.backendInteractor.listEmojiPacks, - ).then((allPacks) => { - this.knownLocalPacks = allPacks - for (const name of Object.keys(this.knownLocalPacks)) { - this.sortPackFiles(name) - } - }) + useEmojiStore() + .getAdminPacks( + this.remotePackInstance, + this.$store.state.api.backendInteractor.listEmojiPacks, + ) + .then((allPacks) => { + this.knownLocalPacks = allPacks + for (const name of Object.keys(this.knownLocalPacks)) { + this.sortPackFiles(name) + } + }) }, listRemotePacks() { - useEmojiStore().getAdminPacks( - this.remotePackInstance, - this.$store.state.api.backendInteractor.listRemoteEmojiPacks, - ) + useEmojiStore() + .getAdminPacks( + this.remotePackInstance, + this.$store.state.api.backendInteractor.listRemoteEmojiPacks, + ) .then((allPacks) => { let inst = this.remotePackInstance if (!inst.startsWith('http')) { diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index 73eab7d90..7abce5420 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -14,8 +14,8 @@ import { import { faBookmark, faCheck, - faChevronRight, faChevronDown, + faChevronRight, faExternalLinkAlt, faEyeSlash, faHistory, diff --git a/src/components/still-image/still-image-emoji-popover.js b/src/components/still-image/still-image-emoji-popover.js index 74d6a002f..979a67b1e 100644 --- a/src/components/still-image/still-image-emoji-popover.js +++ b/src/components/still-image/still-image-emoji-popover.js @@ -1,11 +1,11 @@ import Popover from 'components/popover/popover.vue' import SelectComponent from 'components/select/select.vue' - -import StillImage from './still-image.vue' import { mapState } from 'pinia' -import { useInterfaceStore } from 'src/stores/interface' +import StillImage from './still-image.vue' + import { useEmojiStore } from 'src/stores/emoji' +import { useInterfaceStore } from 'src/stores/interface' export default { components: { StillImage, Popover, SelectComponent }, @@ -28,7 +28,7 @@ export default { isUserAdmin() { return this.$store.state.users.currentUser?.rights.admin }, - ...mapState(useEmojiStore, ['adminPacksLocal', 'adminPacksLocalLoading']) + ...mapState(useEmojiStore, ['adminPacksLocal', 'adminPacksLocalLoading']), }, methods: { displayError(msg) { @@ -64,9 +64,11 @@ export default { }, fetchEmojiPacksIfAdmin() { - useEmojiStore().getAdminPacksLocal().then(() => { - this.$refs.emojiPopover.updateStyles() - }) + useEmojiStore() + .getAdminPacksLocal() + .then(() => { + this.$refs.emojiPopover.updateStyles() + }) }, }, } diff --git a/src/components/user_list_popover/user_list_popover.js b/src/components/user_list_popover/user_list_popover.js index 440fe7694..3d15f3ed4 100644 --- a/src/components/user_list_popover/user_list_popover.js +++ b/src/components/user_list_popover/user_list_popover.js @@ -3,8 +3,8 @@ import { defineAsyncComponent } from 'vue' import RichContent from 'src/components/rich_content/rich_content.jsx' import UnicodeDomainIndicator from '../unicode_domain_indicator/unicode_domain_indicator.vue' -import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useInstanceStore } from 'src/stores/instance.js' +import { useMergedConfigStore } from 'src/stores/merged_config.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -40,7 +40,7 @@ const UserListPopover = { useInstanceStore().restrictedNicknames, ) }, - } + }, } export default UserListPopover diff --git a/src/stores/emoji.js b/src/stores/emoji.js index b7f8262a6..e28143300 100644 --- a/src/stores/emoji.js +++ b/src/stores/emoji.js @@ -1,6 +1,6 @@ +import { merge } from 'lodash' import { defineStore } from 'pinia' -import { merge } from 'lodash' import { useInstanceStore } from 'src/stores/instance.js' import { ensureFinalFallback } from 'src/i18n/languages.js' @@ -187,7 +187,10 @@ export const useEmojiStore = defineStore('emoji', { const listFunction = backendInteractor.listEmojiPacks this.adminPacksLocalLoading = true - this.adminPacksLocal = await this.getAdminPacks(useInstanceStore().server, listFunction) + this.adminPacksLocal = await this.getAdminPacks( + useInstanceStore().server, + listFunction, + ) this.adminPacksLocalLoading = false }, @@ -197,8 +200,6 @@ export const useEmojiStore = defineStore('emoji', { if (!currentUser.rights.admin) return const pageSize = 25 - const allPacks = {} - return await listFunction({ instance, @@ -222,25 +223,22 @@ export const useEmojiStore = defineStore('emoji', { }) .then((data) => data.json()) .then((pageData) => { - if (pageData.error !== undefined) { - return Promise.reject(pageData.error) - } + if (pageData.error !== undefined) { + return Promise.reject(pageData.error) + } return pageData.packs - }) + }), ) } - return Promise - .all(promises) - .then((results) => { - return merge({}, ...results) - }) + return Promise.all(promises).then((results) => { + return merge({}, ...results) + }) }) .then((allPacks) => { // Sort by key - return Object - .keys(allPacks) + return Object.keys(allPacks) .sort() .reduce((acc, key) => { if (key.length === 0) return acc