diff --git a/src/app/splash.tsx b/src/app/splash.tsx
deleted file mode 100644
index df9ed2de..00000000
--- a/src/app/splash.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { invoke } from '@tauri-apps/api';
-import { message } from '@tauri-apps/plugin-dialog';
-import { useEffect } from 'react';
-
-import { useNDK } from '@libs/ndk/provider';
-import { useStorage } from '@libs/storage/provider';
-
-import { LoaderIcon } from '@shared/icons';
-
-import { useNostr } from '@utils/hooks/useNostr';
-
-export function SplashScreen() {
- const { db } = useStorage();
- const { ndk } = useNDK();
- const { fetchUserData } = useNostr();
-
- useEffect(() => {
- async function syncUserData() {
- if (!db.account) {
- await invoke('close_splashscreen');
- } else {
- const onboarding = localStorage.getItem('onboarding');
- const step = JSON.parse(onboarding).state.step || null;
-
- if (step) {
- await invoke('close_splashscreen');
- } else {
- try {
- const userData = await fetchUserData();
- if (userData.status === 'ok') {
- // update last login = current time
- await db.updateLastLogin();
- // close splash screen and open main app screen
- await invoke('close_splashscreen');
- }
- } catch (e) {
- await message(e, {
- title: 'An unexpected error has occurred',
- type: 'error',
- });
- await invoke('close_splashscreen');
- }
- }
- }
- }
-
- if (ndk) {
- syncUserData();
- }
- }, [ndk, db.account]);
-
- return (
-
-
-
-
- {!ndk ? 'Connecting...' : 'Syncing...'}
-
-
-
- );
-}
diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts
index b92aa21c..0a07e0a6 100644
--- a/src/libs/ndk/instance.ts
+++ b/src/libs/ndk/instance.ts
@@ -61,7 +61,7 @@ export const NDKInstance = () => {
});
try {
- await instance.connect(10000);
+ await instance.connect();
} catch (error) {
await message(`NDK instance init failed: ${error}`, {
title: 'Lume',
diff --git a/src/libs/ndk/provider.tsx b/src/libs/ndk/provider.tsx
index 44a5a04e..5b58e4f6 100644
--- a/src/libs/ndk/provider.tsx
+++ b/src/libs/ndk/provider.tsx
@@ -5,6 +5,8 @@ import { PropsWithChildren, createContext, useContext } from 'react';
import { NDKInstance } from '@libs/ndk/instance';
+import { LoaderIcon } from '@shared/icons';
+
interface NDKContext {
ndk: undefined | NDK;
relayUrls: string[];
@@ -20,6 +22,22 @@ const NDKContext = createContext
({
const NDKProvider = ({ children }: PropsWithChildren