Skip to content

Commit

Permalink
fix: bug with WaitScreens
Browse files Browse the repository at this point in the history
  • Loading branch information
cfoust committed Nov 9, 2023
1 parent dd05c97 commit c100577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/taro/screens.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type ScreenUpdate struct{}

func WaitScreens(ctx context.Context, screens ...mux.Screen) Cmd {
ctx, cancel := context.WithCancel(ctx)
defer cancel()

done := make(chan struct{})
for _, screen := range screens {
Expand All @@ -32,6 +31,7 @@ func WaitScreens(ctx context.Context, screens ...mux.Screen) Cmd {
}

return func() Msg {
defer cancel()
select {
case <-done:
return ScreenUpdate{}
Expand Down

0 comments on commit c100577

Please sign in to comment.