chore: simplify js linting

This commit is contained in:
zhom
2025-05-29 11:00:19 +04:00
parent 8d1d970324
commit d87ef3ccf6
37 changed files with 162 additions and 287 deletions
+8 -8
View File
@@ -112,7 +112,7 @@ function UpdateNotificationComponent({
export function useUpdateNotifications() {
const [notifications, setNotifications] = useState<UpdateNotification[]>([]);
const [updatingBrowsers, setUpdatingBrowsers] = useState<Set<string>>(
new Set(),
new Set()
);
const [isClient, setIsClient] = useState(false);
@@ -126,7 +126,7 @@ export function useUpdateNotifications() {
try {
const updates = await invoke<UpdateNotification[]>(
"check_for_browser_updates",
"check_for_browser_updates"
);
setNotifications(updates);
@@ -145,7 +145,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);
@@ -164,7 +164,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
@@ -186,7 +186,7 @@ export function useUpdateNotifications() {
{
browser,
newVersion,
},
}
);
// Show success message based on whether profiles were updated
@@ -252,7 +252,7 @@ export function useUpdateNotifications() {
});
}
},
[notifications, checkForUpdates],
[notifications, checkForUpdates]
);
const handleDismiss = useCallback(
@@ -267,7 +267,7 @@ export function useUpdateNotifications() {
console.error("Failed to dismiss notification:", error);
}
},
[checkForUpdates, isClient],
[checkForUpdates, isClient]
);
// Separate effect to show toasts when notifications change
@@ -292,7 +292,7 @@ export function useUpdateNotifications() {
position: "top-right",
// Remove transparent styling to fix background issue
style: undefined,
},
}
);
});
}, [notifications, updatingBrowsers, handleUpdate, handleDismiss, isClient]);