Skip to content

Commit

Permalink
If channel doesn't exist in recent but is valid, allow switch
Browse files Browse the repository at this point in the history
Caught this before the release, close one.
  • Loading branch information
Xithrius committed Oct 27, 2023
1 parent 07da513 commit d749d8d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ui/components/channel_switcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,23 @@ impl Component for ChannelSwitcherWidget {
return Some(TerminalAction::Enter(TwitchAction::Join(
selected_channel.to_string(),
)));
} else if self.search_input.is_valid() {
self.toggle_focus();
self.unselect();

let selected_channel = self.search_input.to_string();

if self.config.borrow().storage.channels {
self.storage
.borrow_mut()
.add("channels", selected_channel.clone());
}

self.search_input.update("");

self.config.borrow_mut().twitch.channel = selected_channel.clone();

return Some(TerminalAction::Enter(TwitchAction::Join(selected_channel)));
}
}
_ => {
Expand Down

0 comments on commit d749d8d

Please sign in to comment.