mirror of
https://github.com/Kyren223/eko.git
synced 2025-09-05 21:18:14 +00:00
Fixed a bug where it was possible to add the same user multiple times in
the user signals
This commit is contained in:
@@ -167,16 +167,16 @@ func (m *Model) Select() (tea.Cmd, int) {
|
||||
id := snowflake.ID(num)
|
||||
assert.NoError(err, "input is already validated to be valid")
|
||||
|
||||
i := -1
|
||||
index := -1
|
||||
for i, peer := range state.Data.Peers {
|
||||
if peer == id {
|
||||
i = i
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if i != -1 {
|
||||
return nil, i
|
||||
if index != -1 {
|
||||
return nil, index
|
||||
}
|
||||
|
||||
state.Data.Peers = slices.Insert(state.Data.Peers, 0, id)
|
||||
|
Reference in New Issue
Block a user