Skip to content

Commit 19986cf

Browse files
committed
chore: fix lint warnings and stabilize vercel deploy readiness
1 parent 3b7c8a0 commit 19986cf

3 files changed

Lines changed: 50 additions & 3 deletions

File tree

app/components/chat/Player.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export default function Player({
421421
maxWidth: "1100px",
422422
maxHeight: "78vh",
423423
};
424-
}, [videoRatio]);
424+
}, [immersive, videoRatio]);
425425

426426
return (
427427
<div

app/components/dashboard/Navbar.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ import type { IconDefinition } from "@fortawesome/free-solid-svg-icons";
2929

3030
const supabase = createClient();
3131

32-
const SidebarContext = createContext({
32+
type SidebarContextValue = {
33+
collapsed: boolean;
34+
mobileHidden: boolean;
35+
setMobileHidden: (value: boolean) => void;
36+
isMobile: boolean;
37+
};
38+
39+
const noopSetMobileHidden: SidebarContextValue["setMobileHidden"] = () => {};
40+
41+
const SidebarContext = createContext<SidebarContextValue>({
3342
collapsed: false,
3443
mobileHidden: false,
35-
setMobileHidden: (_value: boolean) => {},
44+
setMobileHidden: noopSetMobileHidden,
3645
isMobile: false,
3746
});
3847

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
INSERT INTO public.conversations (id, type)
2+
VALUES ('00000000-0000-0000-0000-000000000001', 'global')
3+
ON CONFLICT (id) DO UPDATE
4+
SET type = EXCLUDED.type;
5+
INSERT INTO public.conversation_participants (conversation_id, user_id, email)
6+
SELECT
7+
'00000000-0000-0000-0000-000000000001',
8+
u.id,
9+
COALESCE(u.email, CONCAT(u.id::text, '@user.local'))
10+
FROM auth.users u
11+
ON CONFLICT (conversation_id, user_id) DO UPDATE
12+
SET email = EXCLUDED.email;
13+
CREATE OR REPLACE FUNCTION public.ensure_user_in_global_chat()
14+
RETURNS TRIGGER AS $$
15+
BEGIN
16+
IF EXISTS (
17+
SELECT 1
18+
FROM public.conversations
19+
WHERE id = '00000000-0000-0000-0000-000000000001'
20+
) THEN
21+
INSERT INTO public.conversation_participants (conversation_id, user_id, email)
22+
VALUES (
23+
'00000000-0000-0000-0000-000000000001',
24+
NEW.id,
25+
COALESCE(NEW.email, CONCAT(NEW.id::text, '@user.local'))
26+
)
27+
ON CONFLICT (conversation_id, user_id) DO UPDATE
28+
SET email = EXCLUDED.email;
29+
END IF;
30+
31+
RETURN NEW;
32+
END;
33+
$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = public;
34+
DROP TRIGGER IF EXISTS on_auth_user_join_global_chat ON auth.users;
35+
CREATE TRIGGER on_auth_user_join_global_chat
36+
AFTER INSERT ON auth.users
37+
FOR EACH ROW
38+
EXECUTE FUNCTION public.ensure_user_in_global_chat();

0 commit comments

Comments
 (0)