dont set sessionstorage on widget

This commit is contained in:
AykutSarac 2023-07-22 20:07:24 +03:00
parent f5be0fa80e
commit 5cae8d75d8
No known key found for this signature in database

View File

@ -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<FileStates & JsonActions>()((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);
}