From 6c416a9338e4edaaa4fe46397250ad1ad677459e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 16 Nov 2024 20:59:45 +0000 Subject: [PATCH] Fix restoring the last used space on desktop This was supposed to work, but it's done in the wrong order. We need to set the current space first, and then select the room - otherwise it doesn't get restored. --- src/roommanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/roommanager.cpp b/src/roommanager.cpp index 01c18a765..ada8e74f7 100644 --- a/src/roommanager.cpp +++ b/src/roommanager.cpp @@ -237,7 +237,6 @@ void RoomManager::loadInitialRoom() } if (m_isMobile) { - // We still need to remember the last space on mobile setCurrentSpace(m_lastSpaceConfig.readEntry(m_connection->userId(), QString()), false); // We don't want to open a room on startup on mobile return; @@ -260,6 +259,7 @@ void RoomManager::openRoomForActiveConnection() setCurrentSpace({}, false); return; } + setCurrentSpace(m_lastSpaceConfig.readEntry(m_connection->userId(), QString()), false); const auto &lastRoom = m_lastRoomConfig.readEntry(m_connection->userId(), QString()); if (lastRoom.isEmpty() || !m_connection->room(lastRoom)) { setCurrentRoom({}); @@ -267,7 +267,6 @@ void RoomManager::openRoomForActiveConnection() m_currentRoom = nullptr; resolveResource(lastRoom); } - setCurrentSpace(m_lastSpaceConfig.readEntry(m_connection->userId(), QString()), false); } UriResolveResult RoomManager::visitUser(User *user, const QString &action)