diff --git a/src/gui/Pages/Chat/Banners/InviteBanner.qml b/src/gui/Pages/Chat/Banners/InviteBanner.qml index 411091b8..830ab35c 100644 --- a/src/gui/Pages/Chat/Banners/InviteBanner.qml +++ b/src/gui/Pages/Chat/Banners/InviteBanner.qml @@ -5,6 +5,8 @@ import QtQuick 2.12 import "../../../Base" Banner { + id: root + property string inviterId: chat.roomInfo.inviter property string inviterName: chat.roomInfo.inviter_name property string inviterAvatar: chat.roomInfo.inviter_avatar @@ -44,11 +46,17 @@ Banner { }, decline: button => { - button.loading = true - py.callClientCoro( - chat.userId, "room_leave", [chat.roomId], () => { - button.loading = false - }) + window.makePopup( + "Popups/LeaveRoomPopup.qml", + { + userId: chat.userId, + roomId: chat.roomId, + roomName: chat.roomInfo.display_name, + inviterId: root.inviterId, + left: chat.roomInfo.left, + leftCallback: () => { button.loading = true }, + }, + ) } }) } diff --git a/src/gui/Popups/LeaveRoomPopup.qml b/src/gui/Popups/LeaveRoomPopup.qml index 07df78e3..7aab359a 100644 --- a/src/gui/Popups/LeaveRoomPopup.qml +++ b/src/gui/Popups/LeaveRoomPopup.qml @@ -14,6 +14,7 @@ HFlickableColumnPopup { property string roomName: "" property string inviterId: "" property bool left: false + property var leftCallback: null function forget() { py.callClientCoro(userId, "room_forget", [roomId], () => { @@ -30,7 +31,7 @@ HFlickableColumnPopup { } function leave() { - py.callClientCoro(userId, "room_leave", [roomId]) + py.callClientCoro(userId, "room_leave", [roomId], leftCallback) popup.close() }