mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-03 06:00:09 +00:00
merge conflicts
This commit is contained in:
commit
ffd141ade4
34 changed files with 1012 additions and 256 deletions
14
apps/web/lib/loadSnap.ts
Normal file
14
apps/web/lib/loadSnap.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { createTLStore, defaultShapeUtils, loadSnapshot } from "tldraw";
|
||||
import { getCanvasData } from "../app/actions/fetchers";
|
||||
import { twitterCardUtil } from "../components/canvas/twitterCard";
|
||||
import { textCardUtil } from "../components/canvas/textCard";
|
||||
|
||||
export async function loadRemoteSnapshot(id: string) {
|
||||
const snapshot = await getCanvasData(id);
|
||||
|
||||
const newStore = createTLStore({
|
||||
shapeUtils: [...defaultShapeUtils, twitterCardUtil, textCardUtil],
|
||||
});
|
||||
loadSnapshot(newStore, snapshot.snapshot);
|
||||
return newStore;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue