Skip to content

Commit

Permalink
fix: Disable auto-freezing for Safari structuredClone compatibility i…
Browse files Browse the repository at this point in the history
…n sync-stores
  • Loading branch information
istarkov authored and kof committed Sep 11, 2024
1 parent 11bb8de commit f0a4286
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/builder/app/shared/sync/sync-stores.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { nanoid } from "nanoid";
import { Store, type Change } from "immerhin";
import { enableMapSet } from "immer";
import { enableMapSet, setAutoFreeze } from "immer";
import type { WritableAtom } from "nanostores";
import { useEffect } from "react";
import { type Publish, subscribe } from "~/shared/pubsub";
Expand Down Expand Up @@ -45,6 +45,8 @@ import {
import { $ephemeralStyles } from "~/canvas/stores";

enableMapSet();
// safari structuredClone fix
setAutoFreeze(false);

const appId = nanoid();

Expand Down

0 comments on commit f0a4286

Please sign in to comment.