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.

(cherry picked from commit 6c416a9338)
This commit is contained in:
Joshua Goins
2024-11-16 20:59:45 +00:00
parent fc14a8eac8
commit 93254431c5

View File

@@ -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)