Add "default_room" to profile settings (#25)

This commit is contained in:
Benjamin Große 2023-01-28 14:09:40 -08:00 committed by Ulyssa
parent b968d8c4a2
commit 4337be108b
No known key found for this signature in database
GPG key ID: 1B3965A3D18B9B64
3 changed files with 13 additions and 1 deletions

View file

@ -138,7 +138,14 @@ impl Application {
let cmds = crate::commands::setup_commands();
let mut locked = store.lock().await;
let win = IambWindow::open(IambId::Welcome, locked.deref_mut()).unwrap();
let win = settings
.tunables
.default_room
.and_then(|room| IambWindow::find(room, locked.deref_mut()).ok())
.or_else(|| IambWindow::open(IambId::Welcome, locked.deref_mut()).ok())
.unwrap();
let cmd = CommandBarState::new(IambBufferId::Command, locked.deref_mut());
let screen = ScreenState::new(win, cmd);