Skip to content

Commit

Permalink
fix potential bug
Browse files Browse the repository at this point in the history
  • Loading branch information
juzeon committed Feb 6, 2024
1 parent 3a190ea commit 61772a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"
"os/exec"
"runtime"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -169,8 +170,9 @@ func UpdateCookiesFile(newCookies map[string]string) error {
if err != nil {
return err
}
oldCookies := slices.Clone(cookies)
for k, v := range newCookies {
cookie, index, ok := lo.FindIndexOf(cookies, func(item FileCookie) bool {
cookie, index, ok := lo.FindIndexOf(oldCookies, func(item FileCookie) bool {
return item.Name == k
})
if ok {
Expand Down

0 comments on commit 61772a6

Please sign in to comment.