Browse Source

Merge branch 'master' into sync-test-s

feature/canvas-chatbot-copilot
jiajia 2 months ago
parent
commit
aa8a630134
  1. 2
      src/components/nodes/GenerateImageNode.tsx
  2. 2
      src/store/execution/nanoBananaExecutor.ts
  3. 2
      src/store/workflowStore.ts
  4. 2
      src/utils/browserFileSystem.ts

2
src/components/nodes/GenerateImageNode.tsx

@ -341,7 +341,7 @@ export function GenerateImageNode({ id, data, selected }: NodeProps<NanoBananaNo
const loadImageById = useCallback(async (imageId: string) => {
const effectiveGenerationsPath = generationsPath
?? (isBrowserFileSystemPath(saveDirectoryPath)
?? (saveDirectoryPath && isBrowserFileSystemPath(saveDirectoryPath)
? joinBrowserFileSystemPath(saveDirectoryPath, "generations")
: null);

2
src/store/execution/nanoBananaExecutor.ts

@ -55,7 +55,7 @@ export async function executeNanoBanana(
const { images: connectedImages, text: connectedText, dynamicInputs } = getConnectedInputs(node.id);
const effectiveGenerationsPath = generationsPath
?? (isBrowserFileSystemPath(saveDirectoryPath)
?? (saveDirectoryPath && isBrowserFileSystemPath(saveDirectoryPath)
? joinBrowserFileSystemPath(saveDirectoryPath, "generations")
: null);

2
src/store/workflowStore.ts

@ -2256,7 +2256,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
workflowName: workflow.name,
saveDirectoryPath: directoryPath || null,
generationsPath: savedConfig?.generationsPath
|| (directoryPath && isBrowserFileSystemPath(directoryPath)
|| (typeof directoryPath === "string" && isBrowserFileSystemPath(directoryPath)
? joinBrowserFileSystemPath(directoryPath, "generations")
: null),
lastSavedAt: savedConfig?.lastSavedAt || null,

2
src/utils/browserFileSystem.ts

@ -40,7 +40,7 @@ declare global {
const memoryHandles = new Map<string, FileSystemDirectoryHandle>();
export function isBrowserFileSystemPath(path: string | null | undefined): path is string {
export function isBrowserFileSystemPath(path: string | null | undefined): boolean {
return typeof path === "string" && path.startsWith(PREFIX);
}

Loading…
Cancel
Save