Add option to accept invitation

This commit is contained in:
Carl Schwan
2020-11-19 07:35:00 +00:00
parent 10935bfb15
commit b4e1c6979f
6 changed files with 81 additions and 66 deletions

View File

@@ -28,6 +28,7 @@ Kirigami.ApplicationWindow {
property var currentRoom: null
property alias pageStack: root.pageStack
property bool invitationOpen: false
readonly property bool hasOpenRoom: currentRoom !== null
@@ -44,18 +45,32 @@ Kirigami.ApplicationWindow {
}
}
function enterRoom(room) {
if (currentRoom != null) {
let item = null;
if (currentRoom != null || invitationOpen) {
currentRoom = null;
pageStack.removePage(pageStack.lastItem);
item = pageStack.replace(roomPage, { 'currentRoom': room, });
} else {
item = pageStack.push(roomPage, { 'currentRoom': room, });
}
var item = pageStack.push(roomPage, { 'currentRoom': room, });
currentRoom = room;
Config.openRoom = room.id;
Config.save();
return item;
}
function openInvitation(room) {
if (currentRoom != null) {
currentRoom = null;
pageStack.removePage(pageStack.lastItem);
}
invitationOpen = true;
pageStack.push("qrc:/imports/NeoChat/Page/InvitationPage.qml", {"room": room});
}
function getBack() {
pageStack.replace(roomPage, { 'currentRoom': currentRoom, });
}
}
contextDrawer: RoomDrawer {