Fix ForgetRoomPopup destruction/callback

This commit is contained in:
miruka
2019-09-09 20:56:10 -04:00
parent 3e01eeef71
commit 988ab94772
5 changed files with 30 additions and 14 deletions

View File

@@ -31,11 +31,12 @@ function makeObject(url, parent=null, properties={}, callback=null) {
}
function makePopup(url, parent=null, properties={}, callback=null) {
function makePopup(url, parent=null, properties={}, callback=null,
autoDestruct=true) {
makeObject(url, parent, properties, (popup) => {
popup.open()
popup.closed.connect(() => { popup.destroy() })
if (callback) callback(popup)
if (autoDestruct) popup.closed.connect(() => { popup.destroy() })
if (callback) callback(popup)
})
}