From 1e2618c0b37b557277720aeb0ab8ca5553e350f0 Mon Sep 17 00:00:00 2001 From: sallerli1 Date: Tue, 16 Jul 2024 15:11:44 +0800 Subject: [PATCH] fix: playgroundApp and setupIduxCharts should not be included in url data --- src/repl-store/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/repl-store/index.ts b/src/repl-store/index.ts index bcb2405..a826196 100644 --- a/src/repl-store/index.ts +++ b/src/repl-store/index.ts @@ -41,8 +41,9 @@ const getInitFiles = (serializedState = '') => { try { const res: Record = JSON.parse(decodeData(serializedState)) for (const filename of Object.keys(res)) { - const isHidden = filename === playgroundApp - files[filename] = new File(filename, res[filename], isHidden) + if (filename !== playgroundApp) { + files[filename] = new File(filename, res[filename]) + } } } catch (err) { console.log(err) @@ -313,7 +314,7 @@ export class ReplStore implements Store { serialize() { const arr = Object.entries(this.getFiles()) - .filter(([file]) => file !== setupIdux && file !== 'import-map.json') + .filter(([file]) => ![playgroundApp, setupIduxCharts, setupIdux, 'import-map.json'].includes(file)) .map(([file, content]) => { if (file === 'import-map.json') { try {