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.

557 B
Raw Blame
// Fixture: a local Electron IPC read is not a remote fetch.
import { memo, useEffect, useState } from 'react';

import { isDesktop } from '@/const/version';
import { autoUpdateService } from '@/services/electron/autoUpdate';

const UpdateChannel = memo(() => {
  const [channel, setChannel] = useState<'stable' | 'beta'>('stable');

  useEffect(() => {
    if (!isDesktop) return;
    autoUpdateService
      .getUpdateChannel()
      .then(setChannel)
      .catch(() => {});
  }, []);

  return <span>{channel}</span>;
});

export default UpdateChannel;