Skip to content

Commit

Permalink
cancel bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linexjlin committed Jan 16, 2024
1 parent cc42e0b commit 8da53a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hotkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func registerHotKeys(userCore *UserCore, st *SysTray) {
}

txtChan = make(chan string, 1024)

cancel()
ctx, cancel = context.WithCancel(context.Background())
fmt.Println("Generating...")
workDone := make(chan struct{}, 2)
Expand Down Expand Up @@ -109,9 +109,7 @@ func registerHotKeys(userCore *UserCore, st *SysTray) {
escCnt = 0
}
lastEscHit = time.Now()
go func() {
cancel()
}()
cancel()
})

s := hook.Start()
Expand Down

0 comments on commit 8da53a6

Please sign in to comment.