also in grid remove room id from nav path when refreshing room vm fails

This commit is contained in:
Bruno Windels 2021-04-27 15:33:12 +02:00
parent c47b27428b
commit 396ec4dfd9

View file

@ -15,6 +15,7 @@ limitations under the License.
*/ */
import {ViewModel} from "../ViewModel.js"; import {ViewModel} from "../ViewModel.js";
import {removeRoomFromPath} from "../navigation/index.js";
function dedupeSparse(roomIds) { function dedupeSparse(roomIds) {
return roomIds.map((id, idx) => { return roomIds.map((id, idx) => {
@ -77,6 +78,9 @@ export class RoomGridViewModel extends ViewModel {
if (this.focusIndex === index) { if (this.focusIndex === index) {
roomVM.focus(); roomVM.focus();
} }
} else {
// close room id
this.navigation.applyPath(removeRoomFromPath(this.navigation.path, roomId));
} }
this.emitChange(); this.emitChange();
} }