Dispatch pageLoaded event upon plug updates

pull/417/head
Zef Hemel 2023-05-24 06:47:39 +02:00
parent c27cd81271
commit 0e58f95920
2 changed files with 2 additions and 0 deletions

View File

@ -208,6 +208,7 @@ export class HttpServer {
switch (body.operation) {
case "fetch": {
const result = await performLocalFetch(body.url, body.options);
console.log("Proxying fetch request to", body.url);
response.headers.set("Content-Type", "application/json");
response.body = JSON.stringify(result);
return;

View File

@ -469,6 +469,7 @@ export class Editor {
if (this.plugsUpdated) {
// To register new commands, update editor state based on new plugs
this.rebuildEditorState();
this.dispatchAppEvent("editor:pageLoaded", this.currentPage);
if (operations) {
// Likely initial sync so let's show visually that we're synced now
this.flashNotification(`Synced ${operations} files`, "info");