Optimize the auth flow (#68)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
1 parent
033cbc082c
commit
85aef535f6
23 files changed
+215
-245
No files matched your search
@@ -47,9 +47,6 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
loading() {
|
||||
return this.$store.state.qrart?.status?.getApplication === Status.Request;
|
||||
},
|
||||
tasks() {
|
||||
// reverse the order of the tasks.items
|
||||
return {
|
||||
@@ -57,39 +54,6 @@ export default defineComponent({
|
||||
items: this.$store.state.qrart?.tasks?.items?.slice().reverse()
|
||||
};
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.$store.dispatch('qrart/setTasks', undefined);
|
||||
await this.getTasks();
|
||||
await this.onScrollDown();
|
||||
// @ts-ignore
|
||||
this.job = setInterval(() => {
|
||||
this.getTasks();
|
||||
}, 5000);
|
||||
},
|
||||
async unmounted() {
|
||||
clearInterval(this.job);
|
||||
},
|
||||
methods: {
|
||||
async onScrollDown() {
|
||||
setTimeout(() => {
|
||||
// scroll to bottom for `.recent`
|
||||
const el = document.querySelector('.recent');
|
||||
if (el) {
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}
|
||||
}, 500);
|
||||
},
|
||||
async getTasks() {
|
||||
// ensure that the previous request has been completed
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
await this.$store.dispatch('qrart/getTasks', {
|
||||
limit: 50,
|
||||
offset: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user