mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-06-06 07:03:52 +02:00
refactor: cleanup
This commit is contained in:
@@ -71,7 +71,7 @@ export function useAppUpdateNotifications() {
|
||||
percentage: 0,
|
||||
speed: undefined,
|
||||
eta: undefined,
|
||||
message: "Starting update...",
|
||||
message: t("appUpdate.toast.startingUpdate"),
|
||||
});
|
||||
|
||||
await invoke("download_and_prepare_app_update", {
|
||||
|
||||
@@ -443,7 +443,7 @@ export function useBrowserDownload() {
|
||||
showToast({
|
||||
id: "geoip-download",
|
||||
type: "download",
|
||||
title: "Downloading GeoIP database",
|
||||
title: i18n.t("browserDownload.toast.geoipDownloading"),
|
||||
stage: "downloading",
|
||||
progress: {
|
||||
percentage,
|
||||
@@ -455,7 +455,7 @@ export function useBrowserDownload() {
|
||||
showToast({
|
||||
id: "geoip-download",
|
||||
type: "download",
|
||||
title: "GeoIP database downloaded successfully!",
|
||||
title: i18n.t("browserDownload.toast.geoipDownloaded"),
|
||||
stage: "completed",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -62,8 +62,12 @@ export function useUpdateNotifications(
|
||||
showToast({
|
||||
id: `auto-update-started-${browser}-${newVersion}`,
|
||||
type: "loading",
|
||||
title: `${browserDisplayName} update started`,
|
||||
description: `Version ${newVersion} download will begin shortly. Browser launch is disabled until update completes.`,
|
||||
title: i18n.t("versionUpdater.toast.updateStarted", {
|
||||
browser: browserDisplayName,
|
||||
}),
|
||||
description: i18n.t("versionUpdater.toast.updateStartedDescription", {
|
||||
version: newVersion,
|
||||
}),
|
||||
duration: 4000,
|
||||
});
|
||||
|
||||
@@ -83,8 +87,11 @@ export function useUpdateNotifications(
|
||||
showToast({
|
||||
id: `auto-update-skip-download-${browser}-${newVersion}`,
|
||||
type: "success",
|
||||
title: `${browserDisplayName} ${newVersion} already available`,
|
||||
description: "Updating profile configurations...",
|
||||
title: i18n.t("versionUpdater.toast.alreadyAvailable", {
|
||||
browser: browserDisplayName,
|
||||
version: newVersion,
|
||||
}),
|
||||
description: i18n.t("versionUpdater.toast.updatingProfiles"),
|
||||
duration: 3000,
|
||||
});
|
||||
} else {
|
||||
@@ -92,8 +99,11 @@ export function useUpdateNotifications(
|
||||
showToast({
|
||||
id: `auto-update-download-starting-${browser}-${newVersion}`,
|
||||
type: "loading",
|
||||
title: `Starting ${browserDisplayName} ${newVersion} download`,
|
||||
description: "Download progress will be shown below...",
|
||||
title: i18n.t("versionUpdater.toast.downloadStarting", {
|
||||
browser: browserDisplayName,
|
||||
version: newVersion,
|
||||
}),
|
||||
description: i18n.t("versionUpdater.toast.downloadProgressBelow"),
|
||||
duration: 4000,
|
||||
});
|
||||
|
||||
@@ -115,24 +125,36 @@ export function useUpdateNotifications(
|
||||
|
||||
// Show success message based on whether profiles were updated
|
||||
if (updatedProfiles.length > 0) {
|
||||
const profileText =
|
||||
const description =
|
||||
updatedProfiles.length === 1
|
||||
? `Profile "${updatedProfiles[0]}" has been updated`
|
||||
: `${updatedProfiles.length} profiles have been updated`;
|
||||
? i18n.t("versionUpdater.toast.singleProfileUpdated", {
|
||||
name: updatedProfiles[0],
|
||||
version: newVersion,
|
||||
})
|
||||
: i18n.t("versionUpdater.toast.multipleProfilesUpdated", {
|
||||
count: updatedProfiles.length,
|
||||
version: newVersion,
|
||||
});
|
||||
|
||||
showToast({
|
||||
id: `auto-update-success-${browser}-${newVersion}`,
|
||||
type: "success",
|
||||
title: `${browserDisplayName} update completed`,
|
||||
description: `${profileText} to version ${newVersion}. You can now launch your browsers with the latest version.`,
|
||||
title: i18n.t("versionUpdater.toast.updateCompleted", {
|
||||
browser: browserDisplayName,
|
||||
}),
|
||||
description,
|
||||
duration: 6000,
|
||||
});
|
||||
} else {
|
||||
showToast({
|
||||
id: `auto-update-success-${browser}-${newVersion}`,
|
||||
type: "success",
|
||||
title: `${browserDisplayName} update completed`,
|
||||
description: `Version ${newVersion} is now available. Running profiles will use the new version when restarted.`,
|
||||
title: i18n.t("versionUpdater.toast.updateCompleted", {
|
||||
browser: browserDisplayName,
|
||||
}),
|
||||
description: i18n.t("versionUpdater.toast.versionAvailable", {
|
||||
version: newVersion,
|
||||
}),
|
||||
duration: 6000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,7 +139,13 @@ export function useVersionUpdater() {
|
||||
try {
|
||||
// Show auto-update start notification
|
||||
showAutoUpdateToast(browserDisplayName, new_version, {
|
||||
description: `Downloading ${browserDisplayName} ${new_version} automatically. Progress will be shown below.`,
|
||||
description: i18n.t(
|
||||
"versionUpdater.toast.autoDownloadStarted",
|
||||
{
|
||||
browser: browserDisplayName,
|
||||
version: new_version,
|
||||
},
|
||||
),
|
||||
});
|
||||
|
||||
// Dismiss the update notification in the backend
|
||||
|
||||
Reference in New Issue
Block a user