Merge branch 'fix/download-emoji-pack-url' into 'develop'

Fix links for downloading remote emoji packs

Closes #91

See merge request pleroma/admin-fe!107
This commit is contained in:
Angelina Filippova 2020-03-25 00:00:47 +00:00
commit 05bc582512
2 changed files with 6 additions and 4 deletions

View file

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix parsing tuples in Pleroma.Upload.Filter.Mogrify and Pleroma.Emails.Mailer settings - Fix parsing tuples in Pleroma.Upload.Filter.Mogrify and Pleroma.Emails.Mailer settings
- Fix settings submit button position on wide screens when sidebar menu is open - Fix settings submit button position on wide screens when sidebar menu is open
- Updates links for downloading remote emoji packs
## [2.0] - 2020-02-27 ## [2.0] - 2020-02-27

View file

@ -62,7 +62,7 @@
<el-form-item> <el-form-item>
<el-link <el-link
v-if="pack.pack['can-download']" v-if="pack.pack['can-download']"
:href="`//${host}/api/pleroma/emoji/packs/${name}/download_shared`" :href="pack.pack['fallback-src']"
:underline="false" :underline="false"
type="primary" type="primary"
target="_blank"> target="_blank">
@ -92,7 +92,7 @@
</p> </p>
<div class="download-shared-pack"> <div class="download-shared-pack">
<el-input v-model="downloadSharedAs" :placeholder=" $t('emoji.downloadAsOptional')"/> <el-input v-model="downloadSharedAs" :placeholder=" $t('emoji.downloadAsOptional')"/>
<el-button type="primary" class="download-shared-pack-button" @click="downloadFromInstance"> <el-button type="primary" class="download-shared-pack-button" @click="downloadFromInstance(pack.pack['homepage'])">
{{ isDesktop ? $t('emoji.downloadSharedPack') : $t('emoji.downloadSharedPackMobile') }} {{ isDesktop ? $t('emoji.downloadSharedPack') : $t('emoji.downloadSharedPackMobile') }}
</el-button> </el-button>
</div> </div>
@ -209,10 +209,11 @@ export default {
} }
}, },
methods: { methods: {
downloadFromInstance() { downloadFromInstance(url) {
const instanceAddress = `${new URL(url).protocol}//${new URL(url).hostname}`
this.$store.dispatch( this.$store.dispatch(
'DownloadFrom', 'DownloadFrom',
{ instanceAddress: this.host, packName: this.name, as: this.downloadSharedAs } { instanceAddress, packName: this.name, as: this.downloadSharedAs }
).then(() => this.$store.dispatch('ReloadEmoji')) ).then(() => this.$store.dispatch('ReloadEmoji'))
.then(() => this.$store.dispatch('SetLocalEmojiPacks')) .then(() => this.$store.dispatch('SetLocalEmojiPacks'))
}, },