mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Fix Android navigation and enforce secure-only messaging
- 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
This commit is contained in:
1 parent
4b8f4315e9
commit
953bd7c03d
7 files changed
+357
-177
No files matched your search
+26
-30
@@ -2,36 +2,32 @@ 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
|
||||
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" />;
|
||||
}
|
||||
|
||||
// If user has no couple, go to pairing
|
||||
if (!user?.couple_id) {
|
||||
return <Redirect href="/(app)/pairing" />;
|
||||
}
|
||||
|
||||
// Otherwise go to home
|
||||
return <Redirect href="/(app)" />;
|
||||
}
|
||||
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: {
|
||||
|
||||
Reference in new issue
Block a user