Fix onboarding and cloud pages appearing in queries
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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 -->`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user