diff options
Diffstat (limited to '')
-rw-r--r-- | wsmsg_unconfirm.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wsmsg_unconfirm.go b/wsmsg_unconfirm.go index 9e12230..48e95c7 100644 --- a/wsmsg_unconfirm.go +++ b/wsmsg_unconfirm.go @@ -22,6 +22,7 @@ package main import ( "context" + "sync/atomic" "github.com/coder/websocket" ) @@ -35,6 +36,17 @@ func messageUnconfirm( ) error { _ = mar + if atomic.LoadUint32(&state) != 2 { + err := writeText(ctx, c, "E :Course selections are not open") + if err != nil { + return wrapError( + errCannotSend, + err, + ) + } + return nil + } + select { case <-ctx.Done(): return wrapError( |