Add loading when fetching remote packs

This commit is contained in:
Angelina Filippova 2020-03-28 01:52:53 +03:00
parent 759dab4729
commit ca9e84ad4b

View file

@ -37,6 +37,7 @@
v-model="remoteInstanceAddress" v-model="remoteInstanceAddress"
:placeholder="$t('emoji.remoteInstanceAddress')" /> :placeholder="$t('emoji.remoteInstanceAddress')" />
<el-button <el-button
v-loading.fullscreen.lock="fullscreenLoading"
:disabled="remoteInstanceAddress.trim() === ''" :disabled="remoteInstanceAddress.trim() === ''"
class="create-pack-button" class="create-pack-button"
@click="refreshRemotePacks"> @click="refreshRemotePacks">
@ -65,7 +66,8 @@ export default {
remoteInstanceAddress: '', remoteInstanceAddress: '',
newPackName: '', newPackName: '',
activeLocalPack: [], activeLocalPack: [],
activeRemotePack: [] activeRemotePack: [],
fullscreenLoading: false
} }
}, },
computed: { computed: {
@ -122,8 +124,10 @@ export default {
message: i18n.t('emoji.refreshed') message: i18n.t('emoji.refreshed')
}) })
}, },
refreshRemotePacks() { async refreshRemotePacks() {
this.$store.dispatch('SetRemoteEmojiPacks', { remoteInstance: this.remoteInstanceAddress }) this.fullscreenLoading = true
await this.$store.dispatch('SetRemoteEmojiPacks', { remoteInstance: this.remoteInstanceAddress })
this.fullscreenLoading = false
}, },
async reloadEmoji() { async reloadEmoji() {
try { try {