fix(stage-tamagotchi): autoUpdater should have channel selected (#1506)

This commit is contained in:
Fetkovich, William
2026-03-29 15:23:51 +08:00
committed by GitHub
parent 07e43010fe
commit ee538769f9
@@ -4,6 +4,8 @@ import type { UpdateInfo } from 'electron-updater'
import type { AutoUpdaterState } from '../../../shared/eventa'
import { arch } from 'node:process'
import electronUpdater from 'electron-updater'
import { is } from '@electron-toolkit/utils'
@@ -21,6 +23,7 @@ import {
import { MockAutoUpdater } from './mock-auto-updater'
export interface AppUpdaterLike {
channel?: string
on: (event: string, listener: (...args: any[]) => void) => any
checkForUpdates: () => Promise<any>
downloadUpdate: () => Promise<any>
@@ -59,6 +62,10 @@ export function setupAutoUpdater(): AutoUpdater {
let state: AutoUpdaterState = { status: 'idle' }
const hooks = new Set<(state: AutoUpdaterState) => void>()
// Fix: explicitly map base channel to architecture to resolve 404 targets.
// electron-updater natively appends OS suffixes (-mac.yml, -linux.yml) automatically.
autoUpdater.channel = arch === 'arm64' ? 'latest-arm64' : 'latest-x64'
function broadcast(next: AutoUpdaterState) {
state = next