folder-top: prevent UI glitch when switching to timeline view
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
12da305022
commit
8414dbcda7
|
@ -20,6 +20,7 @@ export default defineComponent({
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
folders: [] as IFolder[],
|
folders: [] as IFolder[],
|
||||||
|
currentFolder: '<none>',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
@ -30,11 +31,15 @@ export default defineComponent({
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async refresh(): Promise<boolean> {
|
async refresh(): Promise<boolean> {
|
||||||
// Clear folders
|
const folder = utils.getFolderRoutePath(this.config.folders_path);
|
||||||
|
|
||||||
|
// Clear folders if switching to a different folder, otherwise just refresh
|
||||||
|
if (this.currentFolder === folder) {
|
||||||
|
this.currentFolder = folder;
|
||||||
this.folders = [];
|
this.folders = [];
|
||||||
|
}
|
||||||
|
|
||||||
// Get subfolders URL
|
// Get subfolders URL
|
||||||
const folder = utils.getFolderRoutePath(this.config.folders_path);
|
|
||||||
const url = API.Q(API.FOLDERS_SUB(), { folder });
|
const url = API.Q(API.FOLDERS_SUB(), { folder });
|
||||||
|
|
||||||
// Make API call to get subfolders
|
// Make API call to get subfolders
|
||||||
|
|
|
@ -84,7 +84,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
recursive(): boolean {
|
recursive(): boolean {
|
||||||
return this.$route.query.recursive === '1';
|
return !!this.$route.query.recursive;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -94,7 +94,12 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleRecursive() {
|
toggleRecursive() {
|
||||||
this.$router.replace({ query: this.recursive ? {} : { recursive: '1' } });
|
this.$router.replace({
|
||||||
|
query: {
|
||||||
|
...this.$router.currentRoute.query,
|
||||||
|
recursive: this.recursive ? undefined : String(1),
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue