fix: Correct incomplete $state initialization in multiple Svelte components and pages.

This commit is contained in:
2025-12-02 19:18:53 -03:00
parent 4bd9e21748
commit 8a50fb6f61
99 changed files with 520 additions and 519 deletions

View File

@@ -38,16 +38,16 @@
let limpandoNotificacoes = $state(false);
// Helpers para obter valores das queries
const count = $derived((typeof countQuery === 'number' ? countQuery : countQuery?.data) ?? 0);
const todasNotificacoes = $derived(
let count = $derived((typeof countQuery === 'number' ? countQuery : countQuery?.data) ?? 0);
let todasNotificacoes = $derived(
(Array.isArray(todasNotificacoesQuery)
? todasNotificacoesQuery
: todasNotificacoesQuery?.data) ?? []
);
// Separar notificações lidas e não lidas
const notificacoesNaoLidas = $derived(todasNotificacoes.filter((n) => !n.lida));
const notificacoesLidas = $derived(todasNotificacoes.filter((n) => n.lida));
let notificacoesNaoLidas = $derived(todasNotificacoes.filter((n) => !n.lida));
let notificacoesLidas = $derived(todasNotificacoes.filter((n) => n.lida));
// Atualizar contador no store
$effect(() => {