feat: don't spam update notification, show more concise toasts, don't fetch unsupported browser updates

This commit is contained in:
zhom
2025-06-14 16:58:55 +04:00
parent c99eee2c21
commit 545c518a55
10 changed files with 200 additions and 108 deletions
+26
View File
@@ -43,6 +43,7 @@ export interface VersionUpdateToastProps extends BaseToastProps {
current: number;
total: number;
found: number;
current_browser?: string;
};
}
@@ -214,6 +215,7 @@ export function showVersionUpdateToast(
current: number;
total: number;
found: number;
current_browser?: string;
};
duration?: number;
},
@@ -301,3 +303,27 @@ export function dismissToast(id: string) {
export function dismissAllToasts() {
sonnerToast.dismiss();
}
// Add a specific function for unified version update progress
export function showUnifiedVersionUpdateToast(
title: string,
options?: {
id?: string;
description?: string;
progress?: {
current: number;
total: number;
found: number;
current_browser?: string;
};
duration?: number;
},
) {
return showToast({
type: "version-update",
title,
id: "unified-version-update",
duration: Number.POSITIVE_INFINITY, // Keep showing until completed
...options,
});
}