LeftBanner: use ForgotRoomPopup
This commit is contained in:
parent
b7b309ad4c
commit
3e01eeef71
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import "../../Base"
|
||||
import "../../utils.js" as Utils
|
||||
|
||||
Banner {
|
||||
color: theme.chat.leftBanner.background
|
||||
|
@ -21,12 +22,22 @@ Banner {
|
|||
|
||||
buttonCallbacks: ({
|
||||
forget: button => {
|
||||
button.loading = true
|
||||
py.callClientCoro(
|
||||
chatPage.userId, "room_forget", [chatPage.roomId], () => {
|
||||
button.loading = false
|
||||
Qt.callLater(pageLoader.showPage, "Default")
|
||||
})
|
||||
Utils.makePopup(
|
||||
"Popups/ForgetRoomPopup.qml",
|
||||
chatPage,
|
||||
{
|
||||
userId: chatPage.userId,
|
||||
roomId: chatPage.roomId,
|
||||
roomName: chatPage.roomInfo.display_name,
|
||||
forgottenCallback: () => {
|
||||
button.loading = false
|
||||
Qt.callLater(pageLoader.showPage, "Default")
|
||||
},
|
||||
},
|
||||
obj => {
|
||||
obj.onOk.connect(() => { button.loading = true })
|
||||
},
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -12,10 +12,11 @@ BoxPopup {
|
|||
okText: qsTr("Forget")
|
||||
box.focusButton: "ok"
|
||||
|
||||
onOk: py.callClientCoro(userId, "room_forget", [roomId])
|
||||
onOk: py.callClientCoro(userId, "room_forget", [roomId], forgottenCallback)
|
||||
|
||||
|
||||
property string userId: ""
|
||||
property string roomId: ""
|
||||
property string roomName: ""
|
||||
property var forgottenCallback: null
|
||||
}
|
||||
|
|
|
@ -8,10 +8,11 @@ BoxPopup {
|
|||
okText: qsTr("Leave")
|
||||
box.focusButton: "ok"
|
||||
|
||||
onOk: py.callClientCoro(userId, "room_leave", [roomId])
|
||||
onOk: py.callClientCoro(userId, "room_leave", [roomId], leftCallback)
|
||||
|
||||
|
||||
property string userId: ""
|
||||
property string roomId: ""
|
||||
property string roomName: ""
|
||||
property var leftCallback: null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user