mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Only try to close save dialog before destroying surface if it's currently open
Otherwise the closure promise will be rejected as it was already closed with different data, if you ever opened and closed the save dialog before pressing the 'Read' button. This means the code in the $.when will never be run, and the surface never destroyed. Bug: T75589 Change-Id: I3ffdd1c82506bcd2accc0f3fa113c0950a31918e
This commit is contained in:
parent
268a852455
commit
1c04d32d75
|
@ -1082,7 +1082,7 @@ ve.init.mw.ViewPageTarget.prototype.tearDownSurface = function () {
|
|||
this.surface.mwTocWidget.teardown();
|
||||
}
|
||||
|
||||
if ( this.saveDialog ) {
|
||||
if ( this.saveDialog && this.saveDialog.isOpened() ) {
|
||||
// If the save dialog is still open (from saving) close it
|
||||
promises.push( this.saveDialog.close() );
|
||||
// Release the reference
|
||||
|
|
Loading…
Reference in a new issue