background upload
This commit is contained in:
@@ -10,6 +10,7 @@ import { AuthProvider, useAuth } from './contexts/AuthContext';
|
||||
import { DeviceProvider, useDevice } from './contexts/DeviceContext';
|
||||
import { SseProvider } from './contexts/SseContext';
|
||||
import { SseOcrListener } from './hooks/usePollOcr';
|
||||
import { registerBackgroundUpload } from './services/backgroundUpload';
|
||||
import { LoginScreen } from './app/login';
|
||||
import { RegisterScreen } from './app/register';
|
||||
import { HomeScreen } from './app/index';
|
||||
@@ -44,6 +45,12 @@ function AppNavigator() {
|
||||
const { user, isLoading: authLoading } = useAuth();
|
||||
const { isLoading: deviceLoading } = useDevice();
|
||||
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
registerBackgroundUpload();
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
if (authLoading || (user && deviceLoading)) {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
|
||||
Reference in New Issue
Block a user