static-cms/cypress/utils/dismiss-local-backup.js

18 lines
361 B
JavaScript
Raw Normal View History

import { getPhrases } from 'Constants/defaultPhrases';
// Prevents unsaved changes in dev local storage from being used
Cypress.on('window:confirm', message => {
const {
editor: {
editor: { confirmLoadBackup },
},
} = getPhrases();
switch (message) {
case confirmLoadBackup:
return false;
default:
return true;
}
});