Add refreash animation for "Known remotes" import screen

This commit is contained in:
NI
2019-12-31 09:30:35 +08:00
parent 8af9f1a1f1
commit ed2f8157ad
3 changed files with 42 additions and 2 deletions

View File

@@ -18,7 +18,7 @@
-->
<template>
<div id="connect-known-list">
<div id="connect-known-list" :class="{ reloaded: reloaded }">
<div v-if="knownList.length <= 0" id="connect-known-list-empty">
No known remote available
</div>
@@ -101,12 +101,28 @@ export default {
data() {
return {
knownList: [],
reloaded: false,
busy: false
};
},
watch: {
knowns(newVal) {
// Only play reload animation when we're adding data into the records,
// not reducing
const playReloaded = newVal.length > this.knownList.length;
this.reload(newVal);
if (!playReloaded) {
return;
}
const self = this;
self.reloaded = true;
setTimeout(() => {
self.reloaded = false;
}, 500);
}
},
mounted() {