mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 13:52:40 +02:00
feat: moved most things behind correct feature flag
This commit is contained in:
parent
bdb97a0888
commit
c938d39277
13 changed files with 237 additions and 85 deletions
|
|
@ -12,6 +12,10 @@ export interface AgentFilesystemSelection {
|
|||
local_filesystem_mounts?: AgentFilesystemMountSelection[];
|
||||
}
|
||||
|
||||
export interface AgentFilesystemSelectionOptions {
|
||||
localFilesystemEnabled: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_SELECTION: AgentFilesystemSelection = {
|
||||
filesystem_mode: "cloud",
|
||||
client_platform: "web",
|
||||
|
|
@ -23,10 +27,15 @@ export function getClientPlatform(): ClientPlatform {
|
|||
}
|
||||
|
||||
export async function getAgentFilesystemSelection(
|
||||
searchSpaceId?: number | null
|
||||
searchSpaceId?: number | null,
|
||||
options?: AgentFilesystemSelectionOptions
|
||||
): Promise<AgentFilesystemSelection> {
|
||||
const platform = getClientPlatform();
|
||||
if (platform !== "desktop" || !window.electronAPI?.getAgentFilesystemSettings) {
|
||||
if (
|
||||
platform !== "desktop" ||
|
||||
!options?.localFilesystemEnabled ||
|
||||
!window.electronAPI?.getAgentFilesystemSettings
|
||||
) {
|
||||
return { ...DEFAULT_SELECTION, client_platform: platform };
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue