diff --git a/Shogi.Api/Application/ShogiApplication.cs b/Shogi.Api/Application/ShogiApplication.cs
index e659b46..792e18a 100644
--- a/Shogi.Api/Application/ShogiApplication.cs
+++ b/Shogi.Api/Application/ShogiApplication.cs
@@ -69,8 +69,6 @@ public class ShogiApplication(
}
}
-
-
return session;
}
diff --git a/Shogi.Api/Controllers/SessionsController.cs b/Shogi.Api/Controllers/SessionsController.cs
index 4df8378..95b3a2b 100644
--- a/Shogi.Api/Controllers/SessionsController.cs
+++ b/Shogi.Api/Controllers/SessionsController.cs
@@ -54,6 +54,7 @@ public class SessionsController(
///
///
- Search -
++ Search +
+diff --git a/Shogi.UI/Pages/Play/GameBoard/GameBoard.razor b/Shogi.UI/Pages/Play/GameBoard/GameBoard.razor index 1b313eb..1724e1b 100644 --- a/Shogi.UI/Pages/Play/GameBoard/GameBoard.razor +++ b/Shogi.UI/Pages/Play/GameBoard/GameBoard.razor @@ -56,9 +56,16 @@ else if (this.session != null) { var state = await authenticationState; - var accountId = state.User.Claims.First(c => c.Type == ClaimTypes.Name).Value; - this.perspective = accountId == session.Player1 ? WhichPlayer.Player1 : WhichPlayer.Player2; - this.isSpectating = !(accountId == this.session.Player1 || accountId == this.session.Player2); + var accountId = state.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name)?.Value; + if (accountId == null) + { + this.isSpectating = true; + } + else + { + this.perspective = accountId == session.Player1 ? WhichPlayer.Player1 : WhichPlayer.Player2; + this.isSpectating = !(accountId == this.session.Player1 || accountId == this.session.Player2); + } } StateHasChanged(); } diff --git a/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor b/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor index a7c180a..8dbd0b0 100644 --- a/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor +++ b/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor @@ -74,9 +74,11 @@
An error occurred.
- - - } - else - { -Do you wish to delete this session?
- - - - } -An error occurred.
+ + + } + else + { +Do you wish to delete this session?
+ + + + } +