Added Note Sharing Links
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m16s

This commit is contained in:
2026-03-18 18:22:30 -05:00
parent 620071e19e
commit 4414476816
4 changed files with 162 additions and 60 deletions
+5 -3
View File
@@ -3,12 +3,14 @@ import { pb } from "@/lib/pocketbase";
interface EmbedAuthWrapperProps {
children: JSX.Element;
skipAuth?: boolean;
}
export const EmbedAuthWrapper: Component<EmbedAuthWrapperProps> = (props) => {
const [isHydrated, setIsHydrated] = createSignal(pb.authStore.isValid);
const [isHydrated, setIsHydrated] = createSignal(pb.authStore.isValid || !!props.skipAuth);
const handleMessage = (event: MessageEvent) => {
if (props.skipAuth) return; // Don't process auth messages in skip mode
const { data } = event;
console.log('[DEBUG] EmbedAuthWrapper received message:', data?.type);
if (data?.type === "TASGRID_AUTH" && data.token) {
@@ -20,7 +22,7 @@ export const EmbedAuthWrapper: Component<EmbedAuthWrapperProps> = (props) => {
};
onMount(() => {
console.log('[DEBUG] EmbedAuthWrapper mounted. Initial isHydrated:', isHydrated());
console.log('[DEBUG] EmbedAuthWrapper mounted. Initial isHydrated:', isHydrated(), 'skipAuth:', props.skipAuth);
window.addEventListener("message", handleMessage);
});
@@ -30,7 +32,7 @@ export const EmbedAuthWrapper: Component<EmbedAuthWrapperProps> = (props) => {
return (
<Show
when={isHydrated()}
when={isHydrated() || props.skipAuth}
fallback={
<div class="flex flex-col items-center justify-center h-full space-y-4">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>