diff --git a/src/store/modules/emojiPacks.js b/src/store/modules/emojiPacks.js index 4d378508..ec2d6f04 100644 --- a/src/store/modules/emojiPacks.js +++ b/src/store/modules/emojiPacks.js @@ -19,7 +19,7 @@ import Vue from 'vue' const emojiPacks = { state: { - activeCollapseItems: [], + activeTab: '', currentFilesPage: 1, currentPage: 1, filesPageSize: 30, @@ -31,8 +31,8 @@ const emojiPacks = { remotePacks: {} }, mutations: { - SET_ACTIVE_COLLAPSE_ITEMS: (state, items) => { - state.activeCollapseItems = items + SET_ACTIVE_TAB: (state, tab) => { + state.activeTab = tab }, SET_FILES_COUNT: (state, count) => { state.localPackFilesCount = count @@ -177,8 +177,8 @@ const emojiPacks = { commit('UPDATE_LOCAL_PACK_PACK', { name: packName, pack: result.data }) } }, - SetActiveCollapseItems({ commit }, activeItems) { - commit('SET_ACTIVE_COLLAPSE_ITEMS', activeItems) + SetActiveTab({ commit }, activeTab) { + commit('SET_ACTIVE_TAB', activeTab) }, async SetRemoteEmojiPacks({ commit, getters }, { remoteInstance }) { const { data } = await listRemotePacks(getters.authHost, getters.token, remoteInstance) diff --git a/src/views/emojiPacks/components/RemoteEmojiPack.vue b/src/views/emojiPacks/components/RemoteEmojiPack.vue index c83db513..532095df 100644 --- a/src/views/emojiPacks/components/RemoteEmojiPack.vue +++ b/src/views/emojiPacks/components/RemoteEmojiPack.vue @@ -114,7 +114,7 @@ export default { } }, loadRemotePack() { - return this.$store.state.emojiPacks.activeCollapseItems.includes(this.name) + return this.$store.state.emojiPacks.activeTab === this.name }, remoteInstanceAddress() { return this.$store.state.emojiPacks.remoteInstance diff --git a/src/views/emojiPacks/index.vue b/src/views/emojiPacks/index.vue index 1b004e64..1475ad4f 100644 --- a/src/views/emojiPacks/index.vue +++ b/src/views/emojiPacks/index.vue @@ -32,7 +32,7 @@ - + @@ -65,8 +65,8 @@ - - + + @@ -184,9 +184,8 @@ export default { message: i18n.t('emoji.reloaded') }) }, - setActiveCollapseItems(activeItems) { - const items = Array.isArray(activeItems) ? activeItems : [activeItems] - this.$store.dispatch('SetActiveCollapseItems', items) + setActiveTab(activeTab) { + this.$store.dispatch('SetActiveTab', activeTab) } } }