diff --git a/src/store/modules/emojiPacks.js b/src/store/modules/emojiPacks.js index 282a069e..f92e0fa5 100644 --- a/src/store/modules/emojiPacks.js +++ b/src/store/modules/emojiPacks.js @@ -15,11 +15,15 @@ import Vue from 'vue' const packs = { state: { + activeCollapseItems: [], localPacks: {}, remoteInstance: '', remotePacks: {} }, mutations: { + SET_ACTIVE_COLLAPSE_ITEMS: (state, items) => { + state.activeCollapseItems = items + }, SET_LOCAL_PACKS: (state, packs) => { state.localPacks = packs }, @@ -99,6 +103,9 @@ const packs = { commit('UPDATE_LOCAL_PACK_PACK', { name: packName, pack: result.data }) } }, + SetActiveCollapseItems({ commit, state }, activeItems) { + commit('SET_ACTIVE_COLLAPSE_ITEMS', activeItems) + }, async SetLocalEmojiPacks({ commit, getters }) { const { data } = await listPacks(getters.authHost) commit('SET_LOCAL_PACKS', data) diff --git a/src/views/emojiPacks/components/EmojiPack.vue b/src/views/emojiPacks/components/LocalEmojiPack.vue similarity index 71% rename from src/views/emojiPacks/components/EmojiPack.vue rename to src/views/emojiPacks/components/LocalEmojiPack.vue index d31fcf8a..917ff4dd 100644 --- a/src/views/emojiPacks/components/EmojiPack.vue +++ b/src/views/emojiPacks/components/LocalEmojiPack.vue @@ -1,6 +1,6 @@ @@ -125,17 +80,12 @@ export default { required: true } }, - data() { return { - showPackContent: [], - downloadSharedAs: '' + showPackContent: [] } }, computed: { - isDesktop() { - return this.$store.state.app.device === 'desktop' - }, isMobile() { return this.$store.state.app.device === 'mobile' }, @@ -209,15 +159,6 @@ export default { } }, methods: { - downloadFromInstance(url) { - const instanceAddress = `${new URL(url).protocol}//${new URL(url).hostname}` - this.$store.dispatch( - 'DownloadFrom', - { instanceAddress, packName: this.name, as: this.downloadSharedAs } - ).then(() => this.$store.dispatch('ReloadEmoji')) - .then(() => this.$store.dispatch('SetLocalEmojiPacks')) - }, - deletePack() { this.$confirm('This will delete the pack, are you sure?', 'Warning', { confirmButtonText: 'Yes, delete the pack', @@ -229,7 +170,6 @@ export default { .then(() => this.$store.dispatch('SetLocalEmojiPacks')) }).catch(() => {}) }, - savePackMetadata() { this.$store.dispatch('SavePackMetadata', { packName: this.name }) } diff --git a/src/views/emojiPacks/components/RemoteEmojiPack.vue b/src/views/emojiPacks/components/RemoteEmojiPack.vue new file mode 100644 index 00000000..0c9ecaf3 --- /dev/null +++ b/src/views/emojiPacks/components/RemoteEmojiPack.vue @@ -0,0 +1,282 @@ + + + + + diff --git a/src/views/emojiPacks/index.vue b/src/views/emojiPacks/index.vue index 2757e3a4..8154f254 100644 --- a/src/views/emojiPacks/index.vue +++ b/src/views/emojiPacks/index.vue @@ -27,7 +27,7 @@ - + @@ -37,6 +37,7 @@ v-model="remoteInstanceAddress" :placeholder="$t('emoji.remoteInstanceAddress')" /> @@ -45,8 +46,8 @@ - - + + @@ -54,17 +55,19 @@