Extract the space selection logic from setCurrentRoom and use it for writing lastRoomConfig too.

If a setCurrentRoom call changed the active space at the end of its execution, the new room's ID ended up still being written to the old space's lastRoomConfig. This can be triggered using the quick switcher or by clicking on a notification to jump to a room that isn't in the currently opened space.

By extracting this space selection logic into a helper function, we can now calculate this value earlier and use it as the space id when writing lastRoomConfig.

Merge request reports

Loading