Correcao Sidebar Classico e Rail, Correcao Layout, Ajuste de Breakpoint para Tailwind, Ajuste AppTopbar, Ajuste Menu PopOver, Recriado Paleta de Cores, Inserido algumas animações leves, Reajuste Cor items NOVOS da tabela, Drawer Ajuda Corrigido no Logout, Whatsapp, sms, email, recursos extras
This commit is contained in:
@@ -14,33 +14,31 @@
|
||||
| © 2026 — Todos os direitos reservados
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
import { defineStore } from 'pinia'
|
||||
import { supabase } from '@/lib/supabase/client'
|
||||
import { defineStore } from 'pinia';
|
||||
import { supabase } from '@/lib/supabase/client';
|
||||
|
||||
export const useSaasHealthStore = defineStore('saasHealth', {
|
||||
state: () => ({
|
||||
mismatchCount: 0,
|
||||
loading: false,
|
||||
lastLoadedAt: null
|
||||
}),
|
||||
state: () => ({
|
||||
mismatchCount: 0,
|
||||
loading: false,
|
||||
lastLoadedAt: null
|
||||
}),
|
||||
|
||||
actions: {
|
||||
async loadMismatchCount ({ force = false } = {}) {
|
||||
if (this.loading) return
|
||||
if (!force && this.lastLoadedAt && (Date.now() - this.lastLoadedAt) < 30_000) return // cache 30s
|
||||
actions: {
|
||||
async loadMismatchCount({ force = false } = {}) {
|
||||
if (this.loading) return;
|
||||
if (!force && this.lastLoadedAt && Date.now() - this.lastLoadedAt < 30_000) return; // cache 30s
|
||||
|
||||
this.loading = true
|
||||
try {
|
||||
const { count, error } = await supabase
|
||||
.from('v_subscription_feature_mismatch')
|
||||
.select('*', { count: 'exact', head: true })
|
||||
this.loading = true;
|
||||
try {
|
||||
const { count, error } = await supabase.from('v_subscription_feature_mismatch').select('*', { count: 'exact', head: true });
|
||||
|
||||
if (error) throw error
|
||||
this.mismatchCount = Number(count || 0)
|
||||
this.lastLoadedAt = Date.now()
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
if (error) throw error;
|
||||
this.mismatchCount = Number(count || 0);
|
||||
this.lastLoadedAt = Date.now();
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user