fix(web): align Windows update confirmation copy (#7208)
This commit is contained in:
1 parent
89c52a3317
commit
bab4b6f02b
5 files changed
+9
-30
No files matched your search
@@ -3585,7 +3585,7 @@ export default function LegacySidebar() {
|
||||
let confirmed = false;
|
||||
try {
|
||||
confirmed = await ensureLocalApi().dialogs.confirm(
|
||||
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState, navigator.platform),
|
||||
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState),
|
||||
);
|
||||
} catch (error) {
|
||||
setDesktopUpdateActionPending(false);
|
||||
|
||||
@@ -244,30 +244,15 @@ describe("desktop update UI helpers", () => {
|
||||
).toContain("Install update and restart T3 Code?");
|
||||
});
|
||||
|
||||
it("warns Windows users that a silent installation can take several minutes", () => {
|
||||
const message = getDesktopUpdateInstallConfirmationMessage(
|
||||
{
|
||||
it("keeps the same install confirmation copy across desktop platforms", () => {
|
||||
expect(
|
||||
getDesktopUpdateInstallConfirmationMessage({
|
||||
availableVersion: "1.1.0",
|
||||
downloadedVersion: "1.1.0",
|
||||
},
|
||||
"Win32",
|
||||
}),
|
||||
).toBe(
|
||||
"Install update 1.1.0 and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.",
|
||||
);
|
||||
|
||||
expect(message).toContain("may remain closed for several minutes");
|
||||
expect(message).toContain("no installer window may appear");
|
||||
expect(message).toContain("will reopen automatically");
|
||||
});
|
||||
|
||||
it("keeps the additional silent installation warning Windows-specific", () => {
|
||||
const message = getDesktopUpdateInstallConfirmationMessage(
|
||||
{
|
||||
availableVersion: "1.1.0",
|
||||
downloadedVersion: "1.1.0",
|
||||
},
|
||||
"MacIntel",
|
||||
);
|
||||
|
||||
expect(message).not.toContain("may remain closed for several minutes");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts";
|
||||
import { isWindowsPlatform } from "../lib/utils";
|
||||
|
||||
export type DesktopUpdateButtonAction = "download" | "install" | "none";
|
||||
|
||||
@@ -97,13 +96,9 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string
|
||||
|
||||
export function getDesktopUpdateInstallConfirmationMessage(
|
||||
state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">,
|
||||
platform = "",
|
||||
): string {
|
||||
const version = state.downloadedVersion ?? state.availableVersion;
|
||||
const windowsInstallWarning = isWindowsPlatform(platform)
|
||||
? "\n\nOn Windows, T3 Code may remain closed for several minutes while the update installs, and no installer window may appear. T3 Code will reopen automatically when installation finishes."
|
||||
: "";
|
||||
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.${windowsInstallWarning}`;
|
||||
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.`;
|
||||
}
|
||||
|
||||
export function getDesktopUpdateActionError(result: DesktopUpdateActionResult): string | null {
|
||||
|
||||
@@ -284,7 +284,6 @@ function AboutVersionSection() {
|
||||
confirmed = await ensureLocalApi().dialogs.confirm(
|
||||
getDesktopUpdateInstallConfirmationMessage(
|
||||
updateState ?? { availableVersion: null, downloadedVersion: null },
|
||||
navigator.platform,
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
@@ -222,7 +222,7 @@ function SidebarUpdateControl() {
|
||||
let confirmed = false;
|
||||
try {
|
||||
confirmed = await ensureLocalApi().dialogs.confirm(
|
||||
getDesktopUpdateInstallConfirmationMessage(state, navigator.platform),
|
||||
getDesktopUpdateInstallConfirmationMessage(state),
|
||||
);
|
||||
} catch (error) {
|
||||
setIsActionPending(false);
|
||||
|
||||
Reference in new issue
Block a user