fix
This commit is contained in:
parent
6a76b2ef03
commit
d51366b53e
File diff suppressed because one or more lines are too long
|
|
@ -53,7 +53,7 @@ const serverMain = () => ({
|
|||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`Failed to init server ${site_id}`, e);
|
||||
console.log(`Failed to init server ${site_id}\n`, e);
|
||||
}
|
||||
}, 10);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { createRouter } from "radix3";
|
||||
import { FC, Suspense, lazy } from "react";
|
||||
import { Geiger } from "react-geiger";
|
||||
import { GlobalContext, useLocal } from "web-utils";
|
||||
import { w } from "../utils/types/general";
|
||||
import { Loading } from "../utils/ui/loading";
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@ export const EdScriptMonaco: FC<{}> = () => {
|
|||
case "item":
|
||||
{
|
||||
types._raw = declareScope(p, meta, monaco);
|
||||
|
||||
const model = monaco.editor.createModel(
|
||||
trim(val),
|
||||
"typescript",
|
||||
|
|
|
|||
|
|
@ -103,8 +103,11 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
|
|||
);
|
||||
evn(arg);
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
`Error prop ${k} in item [${meta.item.name}], source:`,
|
||||
v.valueBuilt
|
||||
);
|
||||
console.error(e);
|
||||
console.warn(k, v.valueBuilt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { w } from "../types/general";
|
|||
import { baseTypings } from "./types/base";
|
||||
import { extractProp } from "./types/prop";
|
||||
import { prismaExtendType } from "./prisma-extend";
|
||||
import { propPopover } from "../../nova/ed/panel/side/prop-master/prop-form";
|
||||
export type MonacoEditor = Parameters<OnMount>[0];
|
||||
type Monaco = Parameters<OnMount>[1];
|
||||
|
||||
|
|
@ -118,15 +119,13 @@ ${iftext(
|
|||
`\
|
||||
import "./api"
|
||||
import type * as SRVAPI from "${apiPath}";`
|
||||
)}
|
||||
)}
|
||||
|
||||
declare global {
|
||||
const db: prisma.PrismaClient & ${prismaExtendType};
|
||||
|
||||
${baseTypings}
|
||||
|
||||
${propText.join("\n")}
|
||||
|
||||
${iftext(
|
||||
apiTypes,
|
||||
`
|
||||
|
|
@ -140,6 +139,8 @@ declare global {
|
|||
`,
|
||||
"ts:global.d.ts"
|
||||
);
|
||||
|
||||
register(monaco, propText.join("\n"), "ts:typings.d.ts");
|
||||
};
|
||||
|
||||
const loadText = async (url: string) => {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ export const useLocal = <T extends object>(
|
|||
render: () => void;
|
||||
},
|
||||
deps: (deps || []) as any[],
|
||||
promisedKeys: new Set<string>(),
|
||||
ready: false,
|
||||
_loading: {} as any,
|
||||
});
|
||||
|
|
@ -29,22 +28,6 @@ export const useLocal = <T extends object>(
|
|||
if (local.ready === false) {
|
||||
local._loading = {};
|
||||
|
||||
for (const [k, v] of Object.entries(data)) {
|
||||
if (!local.promisedKeys.has(k)) {
|
||||
let val = v;
|
||||
if (typeof val === "object" && val instanceof Promise) {
|
||||
local._loading[k] = true;
|
||||
local.promisedKeys.add(k);
|
||||
(local.data as any)[k] = null;
|
||||
val.then((resolved) => {
|
||||
(local.data as any)[k] = resolved;
|
||||
local._loading[k] = false;
|
||||
local.data.render();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local.data.render = () => {
|
||||
if (local.ready) _render({});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue