{APP_VERSION}
);
}
function AboutVersionSection() {
const queryClient = useQueryClient();
const updateStateQuery = useDesktopUpdateState();
const updateState = updateStateQuery.data ?? null;
const handleButtonClick = useCallback(() => {
const bridge = window.desktopBridge;
if (!bridge) return;
const action = updateState ? resolveDesktopUpdateButtonAction(updateState) : "none";
if (action === "download") {
void bridge
.downloadUpdate()
.then((result) => {
setDesktopUpdateStateQueryData(queryClient, result.state);
})
.catch((error: unknown) => {
toastManager.add({
type: "error",
title: "Could not download update",
description: error instanceof Error ? error.message : "Download failed.",
});
});
return;
}
if (action === "install") {
const confirmed = window.confirm(
getDesktopUpdateInstallConfirmationMessage(
updateState ?? { availableVersion: null, downloadedVersion: null },
),
);
if (!confirmed) return;
void bridge
.installUpdate()
.then((result) => {
setDesktopUpdateStateQueryData(queryClient, result.state);
})
.catch((error: unknown) => {
toastManager.add({
type: "error",
title: "Could not install update",
description: error instanceof Error ? error.message : "Install failed.",
});
});
return;
}
if (typeof bridge.checkForUpdate !== "function") return;
void bridge
.checkForUpdate()
.then((result) => {
setDesktopUpdateStateQueryData(queryClient, result.state);
if (!result.checked) {
toastManager.add({
type: "error",
title: "Could not check for updates",
description:
result.state.message ?? "Automatic updates are not available in this build.",
});
}
})
.catch((error: unknown) => {
toastManager.add({
type: "error",
title: "Could not check for updates",
description: error instanceof Error ? error.message : "Update check failed.",
});
});
}, [queryClient, updateState]);
const action = updateState ? resolveDesktopUpdateButtonAction(updateState) : "none";
const buttonTooltip = updateState ? getDesktopUpdateButtonTooltip(updateState) : null;
const buttonDisabled =
action === "none"
? !canCheckForUpdate(updateState)
: isDesktopUpdateButtonDisabled(updateState);
const actionLabel: Record
{providerCard.versionLabel}
) : null}
{providerCard.isDirty ? (
{providerCard.summary.headline} {providerCard.summary.detail ? ` - ${providerCard.summary.detail}` : null}
{model.slug}
{capLabels.length > 0 ? (
{customModelError}
) : null}Archived {formatRelativeTimeLabel(thread.archivedAt ?? thread.createdAt)} {" \u00b7 Created "} {formatRelativeTimeLabel(thread.createdAt)}