Skip to content

Commit

Permalink
fix: bookmarks context timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
VTGare committed Dec 15, 2024
1 parent 966f7ba commit 28bf4ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@ func bookmarks(b *bot.Bot) func(*gumi.Ctx) error {
}

wg := dgoutils.NewWidget(gctx.Session, gctx.Event.Author.ID, pages)
wg.WithCallback(func(wa dgoutils.WidgetAction, i int) error {
wg.WithCallback(func(_ dgoutils.WidgetAction, i int) error {
ctx := context.WithoutCancel(ctx)
if wg.Pages[i] != nil {
return nil
}
Expand Down Expand Up @@ -725,6 +726,7 @@ func bookmarks(b *bot.Bot) func(*gumi.Ctx) error {
wg.Pages[i] = page
return nil
})

return wg.Start(gctx.Event.ChannelID)
}
}
Expand Down

0 comments on commit 28bf4ef

Please sign in to comment.