From 603e687d70334766f787a7f1fcf05ca5a7d7bdc2 Mon Sep 17 00:00:00 2001 From: Rizky Date: Sun, 17 Dec 2023 11:40:35 +0700 Subject: [PATCH] wip fix --- app/srv/ws/sync/editor/parser/parse-js.ts | 40 ++++++++++--------- .../nova/ed/panel/popup/script/snippet.tsx | 2 +- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/srv/ws/sync/editor/parser/parse-js.ts b/app/srv/ws/sync/editor/parser/parse-js.ts index f15fde1b..45c34793 100644 --- a/app/srv/ws/sync/editor/parser/parse-js.ts +++ b/app/srv/ws/sync/editor/parser/parse-js.ts @@ -70,24 +70,28 @@ export const parseJs = (meta: IMeta) => { attr.type === "JSXAttribute" && attr.name.type === "JSXIdentifier" ) { - if (attr.value) { - if ( - attr.value.type === "JSXExpressionContainer" && - attr.value.expression.loc - ) { - const loc = attr.value.expression.loc as any; - passprop[attr.name.name] = { - value: code.substring(loc.start.index, loc.end.index), - index: loc.start.index, - }; - } else if (attr.value.loc) { - const loc = attr.value.loc as any; - passprop[attr.name.name] = { - value: code.substring(loc.start.index, loc.end.index), - index: loc.start.index, - }; - } - } + passprop[attr.name.name] = { + value: '0', + index: 0, + }; + // if (attr.value) { + // if ( + // attr.value.type === "JSXExpressionContainer" && + // attr.value.expression.loc + // ) { + // const loc = attr.value.expression.loc as any; + // passprop[attr.name.name] = { + // value: code.substring(loc.start.index, loc.end.index), + // index: loc.start.index, + // }; + // } else if (attr.value.loc) { + // const loc = attr.value.loc as any; + // passprop[attr.name.name] = { + // value: code.substring(loc.start.index, loc.end.index), + // index: loc.start.index, + // }; + // } + // } } } } diff --git a/app/web/src/nova/ed/panel/popup/script/snippet.tsx b/app/web/src/nova/ed/panel/popup/script/snippet.tsx index a0a34f7a..cf83b4ca 100644 --- a/app/web/src/nova/ed/panel/popup/script/snippet.tsx +++ b/app/web/src/nova/ed/panel/popup/script/snippet.tsx @@ -58,7 +58,7 @@ effect={async (local) => { ); }} > - <Passprop/> + <PassProp/> );