Format update channel files

This commit is contained in:
young
2026-09-01 16:33:20 +10:00
parent 68e99165d7
commit 0effc914c0
5 changed files with 28 additions and 17 deletions
+1 -4
View File
@@ -1,8 +1,5 @@
import { describe, expect, it } from "vitest";
import {
EXPERIMENTAL_UPDATE_DESCRIPTION,
getUpdateChannelConfiguration,
} from "./updateChannel";
import { EXPERIMENTAL_UPDATE_DESCRIPTION, getUpdateChannelConfiguration } from "./updateChannel";
describe("getUpdateChannelConfiguration", () => {
it("keeps regular clients on stable metadata", () => {
+1 -3
View File
@@ -13,9 +13,7 @@ export function getUpdateChannelConfiguration(
experimentalUpdatesEnabled: boolean,
): UpdateChannelConfiguration {
return {
channel: experimentalUpdatesEnabled
? EXPERIMENTAL_UPDATE_CHANNEL
: STABLE_UPDATE_CHANNEL,
channel: experimentalUpdatesEnabled ? EXPERIMENTAL_UPDATE_CHANNEL : STABLE_UPDATE_CHANNEL,
allowPrerelease: experimentalUpdatesEnabled,
allowDowngrade: false,
};
+1 -4
View File
@@ -5,10 +5,7 @@ import { app, BrowserWindow, dialog } from "electron";
import { autoUpdater } from "electron-updater";
import { USER_DATA_PATH } from "./appPaths";
import { readAppSetting, writeAppSetting } from "./appSettingsStore";
import {
EXPERIMENTAL_UPDATE_DESCRIPTION,
getUpdateChannelConfiguration,
} from "./updateChannel";
import { EXPERIMENTAL_UPDATE_DESCRIPTION, getUpdateChannelConfiguration } from "./updateChannel";
const UPDATE_CHECK_INTERVAL_MS = 6 * 60 * 60 * 1000;
export const UPDATE_REMINDER_DELAY_MS = 3 * 60 * 60 * 1000;
+8 -2
View File
@@ -209,7 +209,9 @@ function getUpdateToastBounds() {
const display = getScreen().getDisplayMatching(hudBounds);
const { workArea } = display;
const x = Math.round(workArea.x + (workArea.width - UPDATE_TOAST_WIDTH) / 2);
const y = Math.round(workArea.y + workArea.height - UPDATE_TOAST_HEIGHT - HUD_EDGE_MARGIN_DIP);
const y = Math.round(
workArea.y + workArea.height - UPDATE_TOAST_HEIGHT - HUD_EDGE_MARGIN_DIP,
);
return {
x,
@@ -460,7 +462,11 @@ export function createHudOverlayWindow(): BrowserWindow {
if (hasShownHudWindow || win.isDestroyed()) {
return;
}
if (updateToastWindow && !updateToastWindow.isDestroyed() && updateToastWindow.isVisible()) {
if (
updateToastWindow &&
!updateToastWindow.isDestroyed() &&
updateToastWindow.isVisible()
) {
hudWasVisibleBeforeUpdateToast = true;
return;
}
+17 -4
View File
@@ -151,7 +151,9 @@ export function UpdateToastWindow() {
return (
<div className={`${styles.window} launch-theme`}>
<section className={styles.card} aria-live="polite" aria-label="Recordly update">
<div className={`${styles.icon} ${payload.phase === "error" ? styles.iconError : ""}`}>
<div
className={`${styles.icon} ${payload.phase === "error" ? styles.iconError : ""}`}
>
<PhaseIcon payload={payload} />
</div>
@@ -175,7 +177,10 @@ export function UpdateToastWindow() {
{payload.phase === "downloading" ? (
<div className={styles.progressBlock}>
<div className={styles.progressTrack}>
<div className={styles.progressFill} style={{ width: `${progress}%` }} />
<div
className={styles.progressFill}
style={{ width: `${progress}%` }}
/>
</div>
<div className={styles.progressMeta}>
<strong>{progress}%</strong>
@@ -184,10 +189,18 @@ export function UpdateToastWindow() {
</div>
) : (
<div className={styles.actions}>
<button type="button" className={styles.secondaryButton} onClick={handleNotNow}>
<button
type="button"
className={styles.secondaryButton}
onClick={handleNotNow}
>
{t("launch.updateToast.notNow", "Not now")}
</button>
<button type="button" className={styles.primaryButton} onClick={handlePrimaryAction}>
<button
type="button"
className={styles.primaryButton}
onClick={handlePrimaryAction}
>
{getPrimaryLabel(payload, t)}
</button>
</div>