Fix gist loading and code not updating issue

This commit is contained in:
Sidharth Vinod
2021-06-05 15:55:59 +05:30
parent 5961c7d451
commit bf8160e31e
3 changed files with 16 additions and 7 deletions
+6
View File
@@ -17,4 +17,10 @@ describe('Check actions', () => {
});
});
});
it('should load gists from URL', () => {
cy.get('#gist').type('https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a');
cy.contains('Load Gist').click();
cy.contains('Go shopping!!');
});
});
+2 -2
View File
@@ -121,8 +121,8 @@
if (!gistURL) {
alert('Please enter a Gist URL first');
}
goto(`/edit?gist=${gistURL}`);
location.reload();
window.location.href = `/edit?gist=${gistURL}`;
// location.reload();
};
let iUrl: string;
+8 -5
View File
@@ -38,9 +38,6 @@ export const loadDataFromUrl = async (): Promise<void> => {
state = {
code,
mermaid: config,
autoSync: true,
updateDiagram: true,
updateEditor: true,
loader: {
type: 'files',
config: {
@@ -48,8 +45,14 @@ export const loadDataFromUrl = async (): Promise<void> => {
configURL
}
}
};
} as State;
}
loaded && updateCodeStore(state);
loaded &&
updateCodeStore({
...state,
autoSync: true,
updateDiagram: true,
updateEditor: true
});
// window.location.search = '';
};