diff --git a/src/api/emojiPacks.js b/src/api/emojiPacks.js index 4edb722b..b2f980a1 100644 --- a/src/api/emojiPacks.js +++ b/src/api/emojiPacks.js @@ -52,17 +52,15 @@ export async function deletePack(host, token, packName) { }) } -export async function downloadFrom(host, instance, packName, as, token) { - if (as.trim() === '') { - as = null - } - +export async function downloadFrom(instanceAddress, packName, as, host, token) { return await request({ baseURL: baseName(host), url: '/api/pleroma/emoji/packs/download', method: 'post', headers: authHeaders(token), - data: { url: baseName(instance), name: packName, as }, + data: as.trim() === '' + ? { url: baseName(instanceAddress), name: packName } + : { url: baseName(instanceAddress), name: packName, as }, timeout: 0 }) } diff --git a/src/store/modules/emojiPacks.js b/src/store/modules/emojiPacks.js index 1ada57b9..6874ed9c 100644 --- a/src/store/modules/emojiPacks.js +++ b/src/store/modules/emojiPacks.js @@ -116,7 +116,7 @@ const emojiPacks = { await deletePack(getters.authHost, getters.token, name) }, async DownloadFrom({ getters }, { instanceAddress, packName, as }) { - const result = await downloadFrom(getters.authHost, instanceAddress, packName, as, getters.token) + const result = await downloadFrom(instanceAddress, packName, as, getters.authHost, getters.token) if (result.data === 'ok') { Message({ diff --git a/src/views/emojiPacks/components/RemoteEmojiPack.vue b/src/views/emojiPacks/components/RemoteEmojiPack.vue index 3dcca6c0..a3ebe017 100644 --- a/src/views/emojiPacks/components/RemoteEmojiPack.vue +++ b/src/views/emojiPacks/components/RemoteEmojiPack.vue @@ -24,7 +24,7 @@