Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.1 KB
Raw Blame
import type { UpdateChannel, UpdaterState } from '@lobechat/electron-client-ipc';

import { ensureElectronIpc } from '@/utils/electron/ipc';

class AutoUpdateService {
  checkUpdate = async () => {
    return ensureElectronIpc().autoUpdate.checkForUpdates();
  };

  installNow = async () => {
    return ensureElectronIpc().autoUpdate.quitAndInstallUpdate();
  };

  installLater = async () => {
    return ensureElectronIpc().autoUpdate.installLater();
  };

  downloadUpdate() {
    return ensureElectronIpc().autoUpdate.downloadUpdate();
  }

  getUpdateChannel = async (): Promise<UpdateChannel> => {
    return ensureElectronIpc().autoUpdate.getUpdateChannel();
  };

  getBuildChannel = async (): Promise<string> => {
    return ensureElectronIpc().autoUpdate.getBuildChannel();
  };

  setUpdateChannel = async (channel: UpdateChannel): Promise<void> => {
    return ensureElectronIpc().autoUpdate.setUpdateChannel(channel);
  };

  getUpdaterState = async (): Promise<UpdaterState> => {
    return ensureElectronIpc().autoUpdate.getUpdaterState();
  };
}

export const autoUpdateService = new AutoUpdateService();