diff --git a/mobile/src/app/_layout.tsx b/mobile/src/app/_layout.tsx
index 2f648e1..81d5b4c 100644
--- a/mobile/src/app/_layout.tsx
+++ b/mobile/src/app/_layout.tsx
@@ -1,19 +1,43 @@
-import { useEffect } from 'react';
+import { useEffect, useState } from 'react';
import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
+import { Text, View } from 'react-native';
import { useAuthStore, type AuthState } from '../store/auth-store';
import { useInboxStore, type InboxState } from '../store/inbox-store';
import { useNotesStore, type NotesState } from '../store/notes-store';
import { useWorkspaceStore, type WorkspaceState } from '../store/workspace-store';
-import { initPlatform } from '../lib/platform';
+import { checkKillSwitch, initPlatform } from '../lib/platform';
+import { colors } from '../theme';
export default function RootLayout() {
+ const [killSwitchState, setKillSwitchState] = useState<{
+ checked: boolean;
+ disabled: boolean;
+ message: string | null;
+ }>({
+ checked: false,
+ disabled: false,
+ message: null,
+ });
+
const bootstrapAuth = useAuthStore((state: AuthState) => state.bootstrap);
const hydrateInbox = useInboxStore((state: InboxState) => state.hydrate);
const hydrateNotes = useNotesStore((state: NotesState) => state.hydrate);
const hydrateWorkspaces = useWorkspaceStore((state: WorkspaceState) => state.hydrate);
useEffect(() => {
+ void checkKillSwitch()
+ .then((state) => {
+ setKillSwitchState({
+ checked: true,
+ disabled: state.disabled,
+ message: state.message,
+ });
+ })
+ .catch(() => {
+ setKillSwitchState({ checked: true, disabled: false, message: null });
+ });
+
void bootstrapAuth();
void initPlatform();
void hydrateNotes();
@@ -21,6 +45,29 @@ export default function RootLayout() {
void hydrateInbox();
}, [bootstrapAuth, hydrateInbox, hydrateNotes, hydrateWorkspaces]);
+ if (killSwitchState.checked && killSwitchState.disabled) {
+ return (
+
+
+
+ NoteLett is temporarily unavailable
+
+
+ {killSwitchState.message ?? 'Service access is currently paused by the platform team. Please try again later.'}
+
+
+ );
+ }
+
return (
<>