Editor refactor: extract system stuff
This commit is contained in:
+13
-11
@@ -137,17 +137,19 @@ export function Panel({
|
||||
break;
|
||||
case "syscall": {
|
||||
const { id, name, args } = data;
|
||||
editor.system.localSyscall("core", name, args).then((result) => {
|
||||
if (!iFrameRef.current?.contentWindow) {
|
||||
// iFrame already went away
|
||||
return;
|
||||
}
|
||||
iFrameRef.current!.contentWindow!.postMessage({
|
||||
type: "syscall-response",
|
||||
id,
|
||||
result,
|
||||
});
|
||||
}).catch((e: any) => {
|
||||
editor.system.localSyscall(name, args).then(
|
||||
(result) => {
|
||||
if (!iFrameRef.current?.contentWindow) {
|
||||
// iFrame already went away
|
||||
return;
|
||||
}
|
||||
iFrameRef.current!.contentWindow!.postMessage({
|
||||
type: "syscall-response",
|
||||
id,
|
||||
result,
|
||||
});
|
||||
},
|
||||
).catch((e: any) => {
|
||||
if (!iFrameRef.current?.contentWindow) {
|
||||
// iFrame already went away
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user