generated from PrivateAIM/typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When polling the PO, if it down or disconnected then toast messages will spam the user. this should be fixed by either using groups, limiting lifespan of message to 0, a flag, or some combination of the three e.g.
const apiState = ref({
isDown: false
});
async function someApiCall() {
try {
const response = await api.call();
if (apiState.value.isDown) {
apiState.value.isDown = false;
toast.add({
severity: 'success',
summary: 'Connected',
detail: 'Connection restored',
life: 3000
});
}
} catch (error) {
if (!apiState.value.isDown) {
apiState.value.isDown = true;
toast.add({
severity: 'error',
summary: 'Connection Error',
detail: 'Unable to reach server',
group: 'api-error',
life: 0 // Sticky until resolved
});
}
}
}This will likely need to be implemented in the hubApi fetch plugin
Metadata
Metadata
Assignees
Labels
No labels