Fix onboarding and cloud pages appearing in queries

This commit is contained in:
Zef Hemel
2023-01-17 09:34:49 +01:00
parent d23846cdbf
commit a53ebbd2e1
8 changed files with 62 additions and 16 deletions
+6 -3
View File
@@ -141,8 +141,8 @@ export class Space extends EventEmitter<SpaceEvents>
return this.spacePrimitives.invokeFunction(plug, env, name, args);
}
listPages(): Set<PageMeta> {
return new Set(this.pageMetaCache.values());
listPages(): PageMeta[] {
return [...new Set(this.pageMetaCache.values())];
}
async listPlugs(): Promise<string[]> {
@@ -254,7 +254,10 @@ export class Space extends EventEmitter<SpaceEvents>
}
private metaCacher(name: string, meta: PageMeta): PageMeta {
this.pageMetaCache.set(name, meta);
if (meta.lastModified !== 0) {
// Don't cache metadata for pages with a 0 lastModified timestamp (usualy dynamically generated pages)
this.pageMetaCache.set(name, meta);
}
return meta;
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ import { FileMeta as PlugFileMeta } from "../../plug-api/plugos-syscall/types.ts
export default (space: Space): SysCallMapping => {
return {
"space.listPages": (): PageMeta[] => {
return [...space.listPages()];
return space.listPages();
},
"space.readPage": async (
_ctx,
+2 -2
View File
@@ -65,9 +65,9 @@ export async function ensureAndLoadSettings(
settings.indexPage,
`Hello! And welcome to your brand new SilverBullet space!
<!-- #include [[💭 silverbullet.md/Getting Started]] -->
<!-- #use [[💭 silverbullet.md/Getting Started]] -->
Loading some onboarding content for you (but doing so does require a working internet connection)...
<!-- /include -->`,
<!-- /use -->`,
);
}