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.

463 B
Raw Blame
import { type ElectronState } from '@/store/electron/initialState';

const userPath = (s: ElectronState) => s.appState.userPath;
const userHomePath = (s: ElectronState) => userPath(s)?.home || '';

const displayRelativePath = (path: string) => (s: ElectronState) => {
  const basePath = userHomePath(s);

  return !!basePath ? path.replaceAll(basePath, '~') : path;
};

export const desktopStateSelectors = {
  displayRelativePath,
  userHomePath,
  userPath,
};