This commit is contained in:
Sidharth Vinod
2021-05-04 17:29:38 +05:30
parent 068de0c067
commit a22e499576
6 changed files with 26 additions and 14 deletions
+8 -6
View File
@@ -39,9 +39,11 @@ export const updateConfig = (config, updateEditor) => {
codeStore.set({ ...state, mermaid: config, updateEditor });
};
const unsubscribe = codeStore.subscribe((state) => {
const currentLocation = get(location).split('/')[1];
replace(
`/${currentLocation || 'edit'}/` + Base64.encodeURI(JSON.stringify(state))
);
});
export const initURLSubscription = () => {
codeStore.subscribe((state) => {
const currentLocation = get(location).split('/')[1];
replace(
`/${currentLocation || 'edit'}/` + Base64.encodeURI(JSON.stringify(state))
);
});
};