Skip to content

Commit

Permalink
Allow no ID for SetSelectedGuild
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Aug 3, 2024
1 parent 9916c93 commit 918e606
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/sidebar/guilds/guilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,14 @@ func (v *View) eachGuild(f func(*Guild) (stop bool)) {
}

// SetSelectedGuild sets the selected guild. It does not propagate the selection
// to the sidebar.
// to the sidebar. If the ID is invalid, it unselects the current guild
// selection.
func (v *View) SetSelectedGuild(id discord.GuildID) {
if !id.IsValid() {
v.Unselect()
return
}

guild := v.Guild(id)
if guild == nil {
slog.Error(
Expand Down

0 comments on commit 918e606

Please sign in to comment.