chiark / gitweb /
Fix type of PreparedPieceState.held in the JS
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 10:59:42 +0000 (11:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 12:30:43 +0000 (13:30 +0100)
I was comparing the JS and Rust versions, and spotted this
discrepancy.

In fact it is assigned to internal fields and variables which are all
nullable, so there is no other code change needed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index f21513abc1db3d46ce669ee636b1167552d18f6a..f0281a0350e0610591b299943adce54fb69e2bc5 100644 (file)
@@ -1747,7 +1747,7 @@ messages.Piece = <MessageHandler>handle_piece_update;
 type PreparedPieceState = {
   pos: Pos,
   svg: string,
-  held: PlayerId,
+  held: PlayerId | null,
   z: ZCoord,
   zg: Generation,
   pinned: boolean,