This reverts commit db973c61e8
.
This commit is contained in:
committed by
Christopher Chedeau
parent
829a65b8cb
commit
ae982e9298
@ -174,22 +174,3 @@ export function saveToLocalStorage(
|
||||
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(elements));
|
||||
localStorage.setItem(LOCAL_STORAGE_KEY_STATE, JSON.stringify(state));
|
||||
}
|
||||
|
||||
export function restoreFromURL(elements: ExcalidrawElement[]) {
|
||||
try {
|
||||
const [savedElements, savedState] = document.location.hash
|
||||
.slice(1)
|
||||
.split(":")
|
||||
.map(atob);
|
||||
return restore(elements, savedElements, savedState);
|
||||
} catch (ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function saveToURL(elements: ExcalidrawElement[], state: AppState) {
|
||||
const hash = [JSON.stringify(elements), JSON.stringify(state)]
|
||||
.map(btoa)
|
||||
.join(":");
|
||||
document.location.replace("#" + hash);
|
||||
}
|
||||
|
@ -12,9 +12,7 @@ export {
|
||||
loadFromJSON,
|
||||
saveAsJSON,
|
||||
restoreFromLocalStorage,
|
||||
saveToLocalStorage,
|
||||
restoreFromURL,
|
||||
saveToURL
|
||||
saveToLocalStorage
|
||||
} from "./data";
|
||||
export { hasBackground, hasStroke, getElementAtPosition } from "./comparisons";
|
||||
export { createScene } from "./createScene";
|
||||
|
Reference in New Issue
Block a user