diff --git a/common/spaces/plug_space_primitives.ts b/common/spaces/plug_space_primitives.ts index 8c40913d..fba1fdcd 100644 --- a/common/spaces/plug_space_primitives.ts +++ b/common/spaces/plug_space_primitives.ts @@ -51,13 +51,16 @@ export class PlugSpacePrimitives implements SpacePrimitives { async fetchFileList(): Promise { const allFiles: FileMeta[] = []; + const alreadySeenFiles = new Set(); for (const { plug, name, operation, env } of this.hook.spaceFunctions) { if ( - operation === "listFiles" && (!this.env || (env && env === this.env)) + operation === "listFiles" && + (!this.env || !env || (env && env === this.env)) ) { try { for (const pm of await plug.invoke(name, [])) { allFiles.push(pm); + alreadySeenFiles.add(pm.name); } } catch (e: any) { if (!e.message.includes("not available")) { @@ -69,6 +72,10 @@ export class PlugSpacePrimitives implements SpacePrimitives { } const files = await this.wrapped.fetchFileList(); for (const pm of files) { + // We'll use the files coming from the wrapped space only as a fallback + if (alreadySeenFiles.has(pm.name)) { + continue; + } allFiles.push(pm); } return allFiles; diff --git a/website/SETTINGS.md b/website/SETTINGS.md index f887c34f..eebf6f6b 100644 --- a/website/SETTINGS.md +++ b/website/SETTINGS.md @@ -3,8 +3,6 @@ This page contains configuration of SilverBullet and its plugs. Some of these changes will go into effect immediately, some require a page reload. ```space-config -# Initial page to load when launching SB, can contain template variables -indexPage: "[[SilverBullet]]" libraries: # The "Core" library is recommended for all users - import: "[[!silverbullet.md/Library/Core/*]]" @@ -68,12 +66,6 @@ smartQuotes: left: "‘" right: "’" -# Defines files to ignore in a format compatible with .gitignore -spaceIgnore: | - dist - largefolder - *.mp4 - # Defines the maximum size of a file you can upload to the space (in MiB) maximumDocumentSize: 10