More error to toast migration

This commit is contained in:
LukeGus
2025-09-09 18:49:57 -05:00
parent 7ffeb51571
commit 56a1dd0b79
6 changed files with 26 additions and 13 deletions

View File

@@ -127,6 +127,9 @@ export function FileManager({onSelectView, embedded = false, initialHost = null}
type: 'directory'
})));
} catch (err: any) {
console.error('Failed to fetch home data:', err);
const {toast} = await import('sonner');
toast.error(t('fileManager.failedToFetchHomeData'));
}
}

View File

@@ -49,6 +49,9 @@ export function HomepageAlertManager({userId, loggedIn}: AlertManagerProps): Rea
setAlerts(sortedAlerts);
setCurrentAlertIndex(0);
} catch (err) {
console.error('Failed to fetch user alerts:', err);
const {toast} = await import('sonner');
toast.error(t('homepage.failedToLoadAlerts'));
setError(t('homepage.failedToLoadAlerts'));
} finally {
setLoading(false);

View File

@@ -43,6 +43,8 @@ export function UserProfile({isTopbarOpen = true}: UserProfileProps) {
setVersionInfo({version: info.localVersion});
} catch (err) {
console.error("Failed to load version info", err);
const {toast} = await import('sonner');
toast.error(t('user.failedToLoadVersionInfo'));
}
};