From 5cae8d75d84eb354bef6da02ff0d71a1bb7e7e20 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Sat, 22 Jul 2023 20:07:24 +0300 Subject: [PATCH] dont set sessionstorage on widget --- src/store/useFile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/useFile.ts b/src/store/useFile.ts index c9686d9..3b322dc 100644 --- a/src/store/useFile.ts +++ b/src/store/useFile.ts @@ -6,6 +6,7 @@ import { toast } from "react-hot-toast"; import { create } from "zustand"; import { defaultJson } from "src/constants/data"; import { contentToJson, jsonToContent } from "src/lib/utils/json/jsonAdapter"; +import { isIframe } from "src/lib/utils/widget"; import { getFromCloud, saveToCloud } from "src/services/json"; import { FileFormat } from "src/types/models"; import useGraph from "./useGraph"; @@ -124,7 +125,7 @@ const useFile = create()((set, get) => ({ if (!useStored.getState().liveTransform && skipUpdate) return; - if (contents && contents.length < 80_000) { + if (contents && contents.length < 80_000 && !isIframe()) { sessionStorage.setItem("content", contents); sessionStorage.setItem("format", get().format); }