Fix gist loading and code not updating issue
This commit is contained in:
@@ -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!!');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = '';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user