Refactor and fix invitations

-Move invitation handling into RoomPage and delete InvitationPage
-Open the new room after accepting the invitation
This commit is contained in:
Tobias Fella
2021-02-02 01:52:09 +01:00
parent 465334e23f
commit 72907a1f18
7 changed files with 66 additions and 71 deletions

View File

@@ -69,7 +69,6 @@ Kirigami.ApplicationWindow {
property var currentRoom: null
property alias pageStack: root.pageStack
property bool invitationOpen: false
property var roomList: null
property Item roomItem: null
@@ -90,8 +89,7 @@ Kirigami.ApplicationWindow {
}
function enterRoom(room) {
let item = null;
if (currentRoom != null || invitationOpen) {
if (currentRoom != null) {
roomItem.currentRoom = room;
pageStack.currentIndex = pageStack.depth - 1;
} else {
@@ -104,15 +102,6 @@ Kirigami.ApplicationWindow {
return roomItem;
}
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, });
}