Only create consent sheet if required

This commit is contained in:
Tobias Fella
2023-06-12 13:20:24 +02:00
parent 32ff22ba89
commit 80b451c27b

View File

@@ -259,8 +259,9 @@ Kirigami.ApplicationWindow {
} }
function onUserConsentRequired(url) { function onUserConsentRequired(url) {
consentSheet.url = url let consent = consentSheetComponent.createObject(QQC2.ApplicationWindow.overlay)
consentSheet.open() consent.url = url
consent.open()
} }
} }
@@ -301,6 +302,8 @@ Kirigami.ApplicationWindow {
} }
} }
Component {
id: consentSheetComponent
Kirigami.OverlaySheet { Kirigami.OverlaySheet {
id: consentSheet id: consentSheet
@@ -320,6 +323,7 @@ Kirigami.ApplicationWindow {
onClicked: UrlHelper.openUrl(consentSheet.url) onClicked: UrlHelper.openUrl(consentSheet.url)
} }
} }
}
Component { Component {
id: createRoomDialog id: createRoomDialog