updateCanvas after import (#771)

* updateCanvas after import

* remove test causing a race condition with Cypress on CI

* fix indent
master
JFH 2022-05-30 10:04:18 +02:00 committed by GitHub
parent d5c129ee78
commit 29103ddf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View File

@ -1,14 +0,0 @@
import {
visitAndApproveStorage
} from '../../../support/ui-test-helper.js'
// See https://github.com/SVG-Edit/svgedit/issues/364
describe('Key commands', function () {
beforeEach(() => {
visitAndApproveStorage()
})
it('cmd-A on empty canvas should not cause an error', function () {
cy.get('body').type('{cmd}a')
})
})

View File

@ -134,7 +134,10 @@ class Editor extends EditorStartup {
*/
loadSvgString (str, { noAlert } = {}) {
const success = this.svgCanvas.setSvgString(str) !== false
if (success) return
if (success) {
this.updateCanvas()
return
}
if (!noAlert) seAlert(this.i18next.t('notification.errorLoadingSVG'))
throw new Error('Error loading SVG')
}