@@ -700,12 +700,15 @@ function dispatchMenuAction(action: string): void {
700700}
701701
702702function handleCheckForUpdatesMenuClick ( ) : void {
703+ const hasUpdateFeedConfig =
704+ readAppUpdateYml ( ) !== null || Boolean ( process . env . T3CODE_DESKTOP_MOCK_UPDATES ) ;
703705 const disabledReason = getAutoUpdateDisabledReason ( {
704706 isDevelopment,
705707 isPackaged : app . isPackaged ,
706708 platform : process . platform ,
707709 appImage : process . env . APPIMAGE ,
708710 disabledByEnv : process . env . T3CODE_DISABLE_AUTO_UPDATE === "1" ,
711+ hasUpdateFeedConfig,
709712 } ) ;
710713 if ( disabledReason ) {
711714 console . info ( "[desktop-updater] Manual update check requested, but updates are disabled." ) ;
@@ -942,13 +945,16 @@ function setUpdateState(patch: Partial<DesktopUpdateState>): void {
942945}
943946
944947function shouldEnableAutoUpdates ( ) : boolean {
948+ const hasUpdateFeedConfig =
949+ readAppUpdateYml ( ) !== null || Boolean ( process . env . T3CODE_DESKTOP_MOCK_UPDATES ) ;
945950 return (
946951 getAutoUpdateDisabledReason ( {
947952 isDevelopment,
948953 isPackaged : app . isPackaged ,
949954 platform : process . platform ,
950955 appImage : process . env . APPIMAGE ,
951956 disabledByEnv : process . env . T3CODE_DISABLE_AUTO_UPDATE === "1" ,
957+ hasUpdateFeedConfig,
952958 } ) === null
953959 ) ;
954960}
@@ -1032,17 +1038,6 @@ async function installDownloadedUpdate(): Promise<{ accepted: boolean; completed
10321038}
10331039
10341040function configureAutoUpdater ( ) : void {
1035- const enabled = shouldEnableAutoUpdates ( ) ;
1036- setUpdateState ( {
1037- ...createInitialDesktopUpdateState ( app . getVersion ( ) , desktopRuntimeInfo ) ,
1038- enabled,
1039- status : enabled ? "idle" : "disabled" ,
1040- } ) ;
1041- if ( ! enabled ) {
1042- return ;
1043- }
1044- updaterConfigured = true ;
1045-
10461041 const githubToken =
10471042 process . env . T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN ?. trim ( ) || process . env . GH_TOKEN ?. trim ( ) || "" ;
10481043 if ( githubToken ) {
@@ -1067,6 +1062,17 @@ function configureAutoUpdater(): void {
10671062 } ) ;
10681063 }
10691064
1065+ const enabled = shouldEnableAutoUpdates ( ) ;
1066+ setUpdateState ( {
1067+ ...createInitialDesktopUpdateState ( app . getVersion ( ) , desktopRuntimeInfo ) ,
1068+ enabled,
1069+ status : enabled ? "idle" : "disabled" ,
1070+ } ) ;
1071+ if ( ! enabled ) {
1072+ return ;
1073+ }
1074+ updaterConfigured = true ;
1075+
10701076 autoUpdater . autoDownload = false ;
10711077 autoUpdater . autoInstallOnAppQuit = false ;
10721078 // Keep alpha branding, but force all installs onto the stable update track.
0 commit comments