mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 19:01:47 +00:00
feat(dashboard): persist notification center state
This commit is contained in:
16
src/shared/lib/notifications/is-table-missing.ts
Normal file
16
src/shared/lib/notifications/is-table-missing.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Detecta se um erro indica que a tabela `dashboard_notification_states`
|
||||
* ainda nao existe no banco (migration pendente).
|
||||
*/
|
||||
export function isNotificationStatesTableMissing(error: unknown): boolean {
|
||||
if (!(error instanceof Error)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const message = error.message.toLowerCase();
|
||||
|
||||
return (
|
||||
message.includes("dashboard_notification_states") &&
|
||||
(message.includes("does not exist") || message.includes("relation"))
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user