1
0

Minor page load fixes

This commit is contained in:
Zef Hemel 2023-10-05 18:24:12 +02:00
parent d8797aa805
commit 386c5ab916
4 changed files with 15 additions and 7 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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 {