Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.env
.env.local
.env.*
!.env.example
.vercel/output
.next
node_modules
8 changes: 6 additions & 2 deletions app/components/ui/install-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ export function InstallBanner() {
const [showSteps, setShowSteps] = useState(false);

useEffect(() => {
const wasDismissed = localStorage.getItem(DISMISSED_KEY) === "true";
setDismissed(wasDismissed);
const timeoutId = window.setTimeout(() => {
const wasDismissed = localStorage.getItem(DISMISSED_KEY) === "true";
setDismissed(wasDismissed);
}, 0);

return () => window.clearTimeout(timeoutId);
}, []);

const handleDismiss = () => {
Expand Down
25 changes: 14 additions & 11 deletions hooks/use-install-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ export function useInstallPrompt(): UseInstallPromptReturn {
const [isInstalled, setIsInstalled] = useState(false);

useEffect(() => {
// Detecta se já está instalado (rodando em standalone)
const standalone =
window.matchMedia("(display-mode: standalone)").matches ||
("standalone" in window.navigator &&
(window.navigator as { standalone?: boolean }).standalone === true);
setIsInstalled(standalone);
const timeoutId = window.setTimeout(() => {
// Detecta se já está instalado (rodando em standalone)
const standalone =
window.matchMedia("(display-mode: standalone)").matches ||
("standalone" in window.navigator &&
(window.navigator as { standalone?: boolean }).standalone === true);
setIsInstalled(standalone);

// Detecta plataforma
const ua = window.navigator.userAgent;
const isIos = /iphone|ipad|ipod/i.test(ua);
const isAndroid = /android/i.test(ua);
setPlatform(isIos ? "ios" : isAndroid ? "android" : "other");
// Detecta plataforma
const ua = window.navigator.userAgent;
const isIos = /iphone|ipad|ipod/i.test(ua);
const isAndroid = /android/i.test(ua);
setPlatform(isIos ? "ios" : isAndroid ? "android" : "other");
}, 0);

// Android/Chrome: captura o evento de instalação nativo
const handleBeforeInstallPrompt = (e: Event) => {
Expand All @@ -45,6 +47,7 @@ export function useInstallPrompt(): UseInstallPromptReturn {
window.addEventListener("beforeinstallprompt", handleBeforeInstallPrompt);

return () => {
window.clearTimeout(timeoutId);
window.removeEventListener(
"beforeinstallprompt",
handleBeforeInstallPrompt
Expand Down
3 changes: 2 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-3.0.x"]
}

datasource db {
Expand Down
18 changes: 11 additions & 7 deletions providers/query-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ export function QueryProvider({ children }: { children: ReactNode }) {
> | null>(null);

useEffect(() => {
// localStorage só existe no browser — criamos o persister no client
const p = createSyncStoragePersister({
storage: window.localStorage,
key: CACHE_KEY,
throttleTime: 1000,
});
setPersister(p);
const timeoutId = window.setTimeout(() => {
// localStorage só existe no browser — criamos o persister no client
const p = createSyncStoragePersister({
storage: window.localStorage,
key: CACHE_KEY,
throttleTime: 1000,
});
setPersister(p);
}, 0);

return () => window.clearTimeout(timeoutId);
}, []);

// Antes do persister estar pronto, renderiza sem persistência
Expand Down
1 change: 0 additions & 1 deletion tests/unit/auth-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ describe('auth-options', () => {
describe('getOptionalEnv', () => {
it('should return env variable value when present', async () => {
process.env.TEST_VAR = 'test-value'
const module = await import('@/server/auth/auth-options')
// Test through provider building
process.env.GOOGLE_CLIENT_ID = 'google-id'
process.env.GOOGLE_CLIENT_SECRET = 'google-secret'
Expand Down
Loading