Minor page load fixes
This commit is contained in:
parent
d8797aa805
commit
386c5ab916
@ -31,7 +31,6 @@ export class EventedSpacePrimitives implements SpacePrimitives {
|
||||
// Avoid race conditions
|
||||
return newFileList;
|
||||
}
|
||||
// console.log("HEREEREEEREEREE");
|
||||
this.alreadyFetching = true;
|
||||
const deletedFiles = new Set<string>(Object.keys(this.spaceSnapshot));
|
||||
for (const meta of newFileList) {
|
||||
|
@ -151,6 +151,9 @@ export class HttpSpacePrimitives implements SpacePrimitives {
|
||||
if (res.status === 404) {
|
||||
throw new Error(`Not found`);
|
||||
}
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to get file meta: ${res.statusText}`);
|
||||
}
|
||||
return this.responseToMeta(name, res);
|
||||
}
|
||||
|
||||
|
@ -764,11 +764,18 @@ export class Client {
|
||||
meta: { name: pageName, lastModified: 0, perm: "rw" } as PageMeta,
|
||||
};
|
||||
} else {
|
||||
console.error("Could not load page", pageName, e);
|
||||
doc = {
|
||||
text: `**ERROR**: ${e.message}`,
|
||||
meta: { name: pageName, lastModified: 0, perm: "ro" } as PageMeta,
|
||||
};
|
||||
this.flashNotification(
|
||||
`Could not load page ${pageName}: ${e.message}`,
|
||||
"error",
|
||||
);
|
||||
if (previousPage) {
|
||||
this.ui.viewDispatch({
|
||||
type: "page-loading",
|
||||
name: previousPage,
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ import {
|
||||
import type { Client } from "./client.ts";
|
||||
import { Panel } from "./components/panel.tsx";
|
||||
import { h } from "./deps.ts";
|
||||
import { async } from "https://cdn.skypack.dev/-/regenerator-runtime@v0.13.9-4Dxus9nU31cBsHxnWq2H/dist=es2020,mode=imports/optimized/regenerator-runtime.js";
|
||||
import { sleep } from "$sb/lib/async.ts";
|
||||
|
||||
export class MainUI {
|
||||
|
Loading…
Reference in New Issue
Block a user