Fix left rooms appearing as joined rooms
This commit is contained in:
		
							
								
								
									
										1
									
								
								TODO.md
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								TODO.md
									
									
									
									
									
								
							@@ -46,7 +46,6 @@
 | 
				
			|||||||
  - Message order isn't preserved when sending a first message in a E2E
 | 
					  - Message order isn't preserved when sending a first message in a E2E
 | 
				
			||||||
    room, then while keys are being shared sending one with another account,
 | 
					    room, then while keys are being shared sending one with another account,
 | 
				
			||||||
    then sending one with the first account again
 | 
					    then sending one with the first account again
 | 
				
			||||||
  - Left rooms reappear as joined rooms
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - If account not in config anymore, discard ui state last page on startup
 | 
					  - If account not in config anymore, discard ui state last page on startup
 | 
				
			||||||
  - Do something when access token is invalid
 | 
					  - Do something when access token is invalid
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,20 +26,6 @@ Item {
 | 
				
			|||||||
    readonly property alias roomPane: roomPane
 | 
					    readonly property alias roomPane: roomPane
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    onRoomInfoChanged: {
 | 
					 | 
				
			||||||
        if (roomInfo.left) {
 | 
					 | 
				
			||||||
            // If left, the room will most likely be gone on client restart.
 | 
					 | 
				
			||||||
            // Try to switch back to the previous page.
 | 
					 | 
				
			||||||
            if (pageLoader.showPrevious()) return
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // If there wasn't any previous page, show default page.
 | 
					 | 
				
			||||||
            window.uiState.page           = "Pages/Default.qml"
 | 
					 | 
				
			||||||
            window.uiState.pageProperties = {}
 | 
					 | 
				
			||||||
            window.uiStateChanged()
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    HLoader {
 | 
					    HLoader {
 | 
				
			||||||
        id: loader
 | 
					        id: loader
 | 
				
			||||||
        anchors.rightMargin: roomPane.visibleSize
 | 
					        anchors.rightMargin: roomPane.visibleSize
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,15 +52,16 @@ HPage {
 | 
				
			|||||||
        Layout.fillWidth: true
 | 
					        Layout.fillWidth: true
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    LeftBanner {
 | 
				
			||||||
 | 
					        id: leftBanner
 | 
				
			||||||
 | 
					        visible: chat.roomInfo.left
 | 
				
			||||||
 | 
					        Layout.fillWidth: true
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Composer {
 | 
					    Composer {
 | 
				
			||||||
        id: composer
 | 
					        id: composer
 | 
				
			||||||
        visible: ! chat.roomInfo.left &&
 | 
					        visible: ! chat.roomInfo.left &&
 | 
				
			||||||
                 ! chat.roomInfo.inviter_id
 | 
					                 ! chat.roomInfo.inviter_id
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LeftBanner {
 | 
					 | 
				
			||||||
        id: leftBanner
 | 
					 | 
				
			||||||
        visible: chat.roomInfo.left
 | 
					 | 
				
			||||||
        Layout.fillWidth: true
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user