updateCanvas after import (#771)
* updateCanvas after import * remove test causing a race condition with Cypress on CI * fix indent
This commit is contained in:
@@ -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')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -134,7 +134,10 @@ class Editor extends EditorStartup {
|
|||||||
*/
|
*/
|
||||||
loadSvgString (str, { noAlert } = {}) {
|
loadSvgString (str, { noAlert } = {}) {
|
||||||
const success = this.svgCanvas.setSvgString(str) !== false
|
const success = this.svgCanvas.setSvgString(str) !== false
|
||||||
if (success) return
|
if (success) {
|
||||||
|
this.updateCanvas()
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!noAlert) seAlert(this.i18next.t('notification.errorLoadingSVG'))
|
if (!noAlert) seAlert(this.i18next.t('notification.errorLoadingSVG'))
|
||||||
throw new Error('Error loading SVG')
|
throw new Error('Error loading SVG')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user