mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-11 07:13:43 +02:00
chore: remove prettier to not conflict with biome
This commit is contained in:
@@ -72,7 +72,7 @@ const isAlphaVersion = (version: string): boolean => {
|
||||
|
||||
export function useBrowserDownload() {
|
||||
const [availableVersions, setAvailableVersions] = useState<GithubRelease[]>(
|
||||
[]
|
||||
[],
|
||||
);
|
||||
const [downloadedVersions, setDownloadedVersions] = useState<string[]>([]);
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
@@ -128,7 +128,7 @@ export function useBrowserDownload() {
|
||||
undefined,
|
||||
{
|
||||
suppressCompletionToast: isAutoUpdate,
|
||||
}
|
||||
},
|
||||
);
|
||||
setDownloadProgress(null);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ export function useBrowserDownload() {
|
||||
`Found ${progress.new_versions_found} new browser versions!`,
|
||||
{
|
||||
duration: 3000,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
// Dismiss any update toasts
|
||||
@@ -179,7 +179,7 @@ export function useBrowserDownload() {
|
||||
});
|
||||
toast.dismiss();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -222,7 +222,7 @@ export function useBrowserDownload() {
|
||||
try {
|
||||
const versionInfos = await invoke<BrowserVersionInfo[]>(
|
||||
"fetch_browser_versions_cached_first",
|
||||
{ browserStr }
|
||||
{ browserStr },
|
||||
);
|
||||
|
||||
// Convert BrowserVersionInfo to GithubRelease format for compatibility
|
||||
@@ -232,7 +232,7 @@ export function useBrowserDownload() {
|
||||
assets: [],
|
||||
published_at: versionInfo.date,
|
||||
is_alpha: versionInfo.is_prerelease,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
setAvailableVersions(githubReleases);
|
||||
@@ -257,13 +257,13 @@ export function useBrowserDownload() {
|
||||
// Get versions with new count info and cached detailed info
|
||||
const result = await invoke<BrowserVersionsResult>(
|
||||
"fetch_browser_versions_with_count_cached_first",
|
||||
{ browserStr }
|
||||
{ browserStr },
|
||||
);
|
||||
|
||||
// Get detailed version info for compatibility
|
||||
const versionInfos = await invoke<BrowserVersionInfo[]>(
|
||||
"fetch_browser_versions_cached_first",
|
||||
{ browserStr }
|
||||
{ browserStr },
|
||||
);
|
||||
|
||||
// Convert BrowserVersionInfo to GithubRelease format for compatibility
|
||||
@@ -273,7 +273,7 @@ export function useBrowserDownload() {
|
||||
assets: [],
|
||||
published_at: versionInfo.date,
|
||||
is_alpha: versionInfo.is_prerelease,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
setAvailableVersions(githubReleases);
|
||||
@@ -285,7 +285,7 @@ export function useBrowserDownload() {
|
||||
{
|
||||
duration: 3000,
|
||||
description: `Total available: ${result.total_versions_count} versions`,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ export function useBrowserDownload() {
|
||||
try {
|
||||
const downloadedVersions = await invoke<string[]>(
|
||||
"get_downloaded_browser_versions",
|
||||
{ browserStr }
|
||||
{ browserStr },
|
||||
);
|
||||
setDownloadedVersions(downloadedVersions);
|
||||
return downloadedVersions;
|
||||
@@ -319,7 +319,7 @@ export function useBrowserDownload() {
|
||||
async (
|
||||
browserStr: string,
|
||||
version: string,
|
||||
suppressNotifications = false
|
||||
suppressNotifications = false,
|
||||
) => {
|
||||
const browserName = getBrowserDisplayName(browserStr);
|
||||
setIsDownloading(true);
|
||||
@@ -343,14 +343,14 @@ export function useBrowserDownload() {
|
||||
setIsDownloading(false);
|
||||
}
|
||||
},
|
||||
[loadDownloadedVersions]
|
||||
[loadDownloadedVersions],
|
||||
);
|
||||
|
||||
const isVersionDownloaded = useCallback(
|
||||
(version: string) => {
|
||||
return downloadedVersions.includes(version);
|
||||
},
|
||||
[downloadedVersions]
|
||||
[downloadedVersions],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -15,7 +15,7 @@ export function useTableSorting() {
|
||||
const loadSettings = async () => {
|
||||
try {
|
||||
const settings = await invoke<TableSortingSettings>(
|
||||
"get_table_sorting_settings"
|
||||
"get_table_sorting_settings",
|
||||
);
|
||||
setSortingSettings(settings);
|
||||
} catch (error) {
|
||||
@@ -39,7 +39,7 @@ export function useTableSorting() {
|
||||
console.error("Failed to save table sorting settings:", error);
|
||||
}
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
// Convert our settings to tanstack table sorting format
|
||||
@@ -67,7 +67,7 @@ export function useTableSorting() {
|
||||
void saveSortingSettings(newSettings);
|
||||
}
|
||||
},
|
||||
[saveSortingSettings, isLoaded]
|
||||
[saveSortingSettings, isLoaded],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,7 +18,7 @@ interface UpdateNotification {
|
||||
export function useUpdateNotifications() {
|
||||
const [notifications, setNotifications] = useState<UpdateNotification[]>([]);
|
||||
const [updatingBrowsers, setUpdatingBrowsers] = useState<Set<string>>(
|
||||
new Set()
|
||||
new Set(),
|
||||
);
|
||||
const [isClient, setIsClient] = useState(false);
|
||||
|
||||
@@ -32,7 +32,7 @@ export function useUpdateNotifications() {
|
||||
|
||||
try {
|
||||
const updates = await invoke<UpdateNotification[]>(
|
||||
"check_for_browser_updates"
|
||||
"check_for_browser_updates",
|
||||
);
|
||||
setNotifications(updates);
|
||||
|
||||
@@ -51,7 +51,7 @@ export function useUpdateNotifications() {
|
||||
|
||||
// Dismiss all notifications for this browser first
|
||||
const browserNotifications = notifications.filter(
|
||||
(n) => n.browser === browser
|
||||
(n) => n.browser === browser,
|
||||
);
|
||||
for (const notification of browserNotifications) {
|
||||
toast.dismiss(notification.id);
|
||||
@@ -70,7 +70,7 @@ export function useUpdateNotifications() {
|
||||
if (isDownloaded) {
|
||||
// Browser already exists, skip download and go straight to profile update
|
||||
console.log(
|
||||
`${browserDisplayName} ${newVersion} already exists, skipping download`
|
||||
`${browserDisplayName} ${newVersion} already exists, skipping download`,
|
||||
);
|
||||
} else {
|
||||
// Mark download as auto-update in the backend for toast suppression
|
||||
@@ -92,7 +92,7 @@ export function useUpdateNotifications() {
|
||||
{
|
||||
browser,
|
||||
newVersion,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Show success message based on whether profiles were updated
|
||||
@@ -158,7 +158,7 @@ export function useUpdateNotifications() {
|
||||
});
|
||||
}
|
||||
},
|
||||
[notifications, checkForUpdates]
|
||||
[notifications, checkForUpdates],
|
||||
);
|
||||
|
||||
const handleDismiss = useCallback(
|
||||
@@ -173,7 +173,7 @@ export function useUpdateNotifications() {
|
||||
console.error("Failed to dismiss notification:", error);
|
||||
}
|
||||
},
|
||||
[checkForUpdates, isClient]
|
||||
[checkForUpdates, isClient],
|
||||
);
|
||||
|
||||
// Separate effect to show toasts when notifications change
|
||||
@@ -198,7 +198,7 @@ export function useUpdateNotifications() {
|
||||
position: "top-right",
|
||||
// Remove transparent styling to fix background issue
|
||||
style: undefined,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}, [notifications, updatingBrowsers, handleUpdate, handleDismiss, isClient]);
|
||||
|
||||
@@ -61,7 +61,7 @@ export function useVersionUpdater() {
|
||||
total: progress.total_browsers,
|
||||
found: progress.new_versions_found,
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
showLoadingToast("Starting version update check...", {
|
||||
@@ -81,7 +81,7 @@ export function useVersionUpdater() {
|
||||
duration: 4000,
|
||||
description:
|
||||
"Version information has been updated in the background",
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
toast.success("No new browser versions found", {
|
||||
@@ -103,7 +103,7 @@ export function useVersionUpdater() {
|
||||
description: "Check your internet connection and try again",
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -130,7 +130,7 @@ export function useVersionUpdater() {
|
||||
const loadUpdateStatus = useCallback(async () => {
|
||||
try {
|
||||
const [lastUpdate, timeUntilNext] = await invoke<[number | null, number]>(
|
||||
"get_version_update_status"
|
||||
"get_version_update_status",
|
||||
);
|
||||
setLastUpdateTime(lastUpdate);
|
||||
setTimeUntilNextUpdate(timeUntilNext);
|
||||
@@ -143,18 +143,18 @@ export function useVersionUpdater() {
|
||||
try {
|
||||
setIsUpdating(true);
|
||||
const results = await invoke<BackgroundUpdateResult[]>(
|
||||
"trigger_manual_version_update"
|
||||
"trigger_manual_version_update",
|
||||
);
|
||||
|
||||
const totalNewVersions = results.reduce(
|
||||
(sum, result) => sum + result.new_versions_count,
|
||||
0
|
||||
0,
|
||||
);
|
||||
const successfulUpdates = results.filter(
|
||||
(r) => r.updated_successfully
|
||||
(r) => r.updated_successfully,
|
||||
).length;
|
||||
const failedUpdates = results.filter(
|
||||
(r) => !r.updated_successfully
|
||||
(r) => !r.updated_successfully,
|
||||
).length;
|
||||
|
||||
if (failedUpdates > 0) {
|
||||
@@ -194,7 +194,7 @@ export function useVersionUpdater() {
|
||||
try {
|
||||
const result = await invoke<BrowserVersionsResult>(
|
||||
"fetch_browser_versions_with_count",
|
||||
{ browserStr }
|
||||
{ browserStr },
|
||||
);
|
||||
|
||||
// Show notification about new versions if any were found
|
||||
@@ -205,7 +205,7 @@ export function useVersionUpdater() {
|
||||
{
|
||||
duration: 3000,
|
||||
description: `Total available: ${result.total_versions_count} versions`,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ export function useVersionUpdater() {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const formatTimeUntilUpdate = useCallback((seconds: number): string => {
|
||||
@@ -251,7 +251,7 @@ export function useVersionUpdater() {
|
||||
}
|
||||
return "Just now";
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user