diff --git a/app/web/src/nova/ed/logic/tree/sync-walk-comp.tsx b/app/web/src/nova/ed/logic/tree/sync-walk-comp.tsx index 00ed4a9f..e5af6ed1 100644 --- a/app/web/src/nova/ed/logic/tree/sync-walk-comp.tsx +++ b/app/web/src/nova/ed/logic/tree/sync-walk-comp.tsx @@ -38,7 +38,9 @@ export const loadCompSnapshot = async ( meta, tree, async on_update(bin, origin) { - if (origin === "sv_remote" || origin === "local") return; + if (origin === "sv_remote" || origin === "local") { + return; + } const res = await p.sync.yjs.sv_local( "comp", diff --git a/app/web/src/nova/ed/panel/popup/script/monaco.tsx b/app/web/src/nova/ed/panel/popup/script/monaco.tsx index 5c2140ae..a3c48911 100644 --- a/app/web/src/nova/ed/panel/popup/script/monaco.tsx +++ b/app/web/src/nova/ed/panel/popup/script/monaco.tsx @@ -76,7 +76,8 @@ export const ScriptMonaco = () => { if (!meta) return null; const item = meta.item; - const adv = item.adv || {}; + const adv = meta.mitem?.get("adv")?.toJSON() || {}; + item.adv = adv; const doEdit = async (newval: string, all?: boolean) => { if (local.editor && jscript.prettier.standalone) { diff --git a/app/web/src/nova/view/render/meta/script.tsx b/app/web/src/nova/view/render/meta/script.tsx index c68f1680..44fe3494 100644 --- a/app/web/src/nova/view/render/meta/script.tsx +++ b/app/web/src/nova/view/render/meta/script.tsx @@ -71,25 +71,26 @@ export const ViewMetaScript: FC<{ }; } - if (renderLimit[v.current.page_id][item.id].ts - Date.now() < 100) { + if (Math.abs(renderLimit[v.current.page_id][item.id].ts - Date.now()) < 100) { renderLimit[v.current.page_id][item.id].count++; + + if (renderLimit[v.current.page_id][item.id].count > 100) { + let js = ""; + if (typeof item.adv?.js === "string") { + js = item.adv.js; + } + console.warn( + `Maximum render limit (100 render in 100ms) reached in item [${ + item.name + }]:\n${js.length > 30 ? js.substring(0, 30) + "..." : js}` + ); + return renderLimit[v.current.page_id][item.id].cache; + } } else { renderLimit[v.current.page_id][item.id].ts = Date.now(); renderLimit[v.current.page_id][item.id].count = 1; } - if (renderLimit[v.current.page_id][item.id].count > 100) { - let js = ""; - if (typeof item.adv?.js === "string") { - js = item.adv.js; - } - console.warn( - `Maximum render limit (100 render in 100ms) reached in item [${item.name - }]:\n${js.length > 30 ? js.substring(0, 30) + "..." : js}` - ); - return renderLimit[v.current.page_id][item.id].cache; - } - const children = ; let args = {};