import { revealItemInDir } from "@tauri-apps/plugin-opener"; import { patchModel, settingsAtom } from "@yaakapp-internal/models"; import { Heading, VStack } from "@yaakapp-internal/ui"; import { useAtomValue } from "jotai"; import { activeWorkspaceAtom } from "../../hooks/useActiveWorkspace"; import { useCheckForUpdates } from "../../hooks/useCheckForUpdates"; import { appInfo } from "../../lib/appInfo"; import { revealInFinderText } from "../../lib/reveal"; import { CargoFeature } from "../CargoFeature"; import { IconButton } from "../core/IconButton"; import { ModelSettingRowBoolean, ModelSettingRowNumber, ModelSettingSelectControl, SettingValue, SettingRow, SettingRowBoolean, SettingRowSelect, SettingsList, SettingsSection, } from "../core/SettingRow"; export function SettingsGeneral() { const workspace = useAtomValue(activeWorkspaceAtom); const settings = useAtomValue(settingsAtom); const checkForUpdates = useCheckForUpdates(); if (settings == null || workspace == null) { return null; } return (
General

Configure general settings for update behavior and more.

checkForUpdates.mutateAsync()} />
patchModel(settings, { autoupdate: v === "auto" })} options={[ { label: "Automatic", value: "auto" }, { label: "Manual", value: "manual" }, ]} /> {}} />
Workspace{" "} {workspace.name} } > Number.parseInt(value, 10) >= 0} /> revealItemInDir(appInfo.appDataDir), }, ]} /> revealItemInDir(appInfo.appLogDir), }, ]} />
); }