feat(#13): Toast the user when a processing run completes
This commit is contained in:
+15
-2
@@ -1,9 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed} from 'vue';
|
import {computed, watchEffect} from 'vue';
|
||||||
import {RouterView, useRoute} from 'vue-router';
|
import {RouterView, useRoute} from 'vue-router';
|
||||||
import {Sidebar} from './sidebar';
|
import {Sidebar} from './sidebar';
|
||||||
import {ConfirmModal} from '@/confirm';
|
import {ConfirmModal} from '@/confirm';
|
||||||
import {ToastContainer} from '@/toast';
|
import {ToastContainer, toast} from '@/toast';
|
||||||
|
import {onActivitiesProcessed} from '@/activity';
|
||||||
|
import {useAuthStore} from '@/auth';
|
||||||
import {routeNames} from '@/routes';
|
import {routeNames} from '@/routes';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -11,6 +13,17 @@ const route = useRoute();
|
|||||||
const hideSidebar = computed(() => {
|
const hideSidebar = computed(() => {
|
||||||
return route.name === routeNames.callback || route.name === routeNames.about;
|
return route.name === routeNames.callback || route.name === routeNames.about;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const authStore = useAuthStore();
|
||||||
|
|
||||||
|
watchEffect(onCleanup => {
|
||||||
|
if (!authStore.isAuthenticated) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const unsubscribe = onActivitiesProcessed(() => toast.info('Processing run completed'));
|
||||||
|
|
||||||
|
onCleanup(unsubscribe);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user