Files
openidea/src/platform/updateSource.ts
T
Emanyzwww 14d9cdff11 feat(app): show a What's New page after an update (#2664)
After an update the restarted app opens what the new version brought as an editor tab, and Help > What's New reopens it at any time. Its checkbox turns the automatic opening off for later updates; the same switch sits on System Settings > Updates next to the update checks. The update balloon keeps a one-paragraph summary.

The release workflow fills the updater manifest's notes from the release body without its Download section, the install records them, and a version installed outside the app reads them from the manifest. The first start of a different version is recognised from the last run version kept in settings.
2026-11-11 16:42:32 +08:00

12 lines
538 B
TypeScript

import { resolveLocale } from "@/platform/i18n";
import type { UpdateSource } from "@/platform/ipc";
import { useProject } from "@/platform/project";
/** System Settings > Updates > Update source; `auto` picks the CNB mirror for the Chinese UI. */
export function updateSource(): UpdateSource {
const { settings } = useProject.getState();
const chosen = settings?.general?.updateSource;
if (chosen === "github" || chosen === "cnb") return chosen;
return resolveLocale(settings?.appearance?.locale) === "zh" ? "cnb" : "github";
}