mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
- Remove forced redirect to pairing screen for users without a couple - Users now go directly to dashboard after onboarding (matches iOS behavior) - Add secureReady state to InputBar to prevent sending before E2EE is ready - Pre-fetch admin key during key initialization to reduce chat load time - Block media uploads until encryption is fully ready - Add security status indicator in chat when encryption is initializing
40 lines
1.1 KiB
TypeScript
Executable File
40 lines
1.1 KiB
TypeScript
Executable File
import { Redirect } from "expo-router";
|
|
import { useAuthStore } from "../src/store";
|
|
import { View, ActivityIndicator, StyleSheet } from "react-native";
|
|
|
|
export default function Index() {
|
|
const { isAuthenticated, isLoading, user } = useAuthStore();
|
|
|
|
// Show loading state while auth is being determined
|
|
if (isLoading) {
|
|
return (
|
|
<View style={styles.container}>
|
|
<ActivityIndicator size="large" color="#e94560" />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
// Redirect based on auth state
|
|
if (!isAuthenticated) {
|
|
return <Redirect href="/(auth)/login" />;
|
|
}
|
|
|
|
// If user hasn't completed onboarding, go to onboarding first
|
|
if (!user?.onboarding_completed) {
|
|
return <Redirect href="/(app)/onboarding" />;
|
|
}
|
|
|
|
// Go to home/dashboard - users can pair from within the app
|
|
// No forced redirect to pairing for users without a couple
|
|
return <Redirect href="/(app)" />;
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
backgroundColor: "#1a1a2e",
|
|
},
|
|
});
|