Skip to content

Commit

Permalink
Turns out ASP.NET Core breaks if your enum backing type isn't int.
Browse files Browse the repository at this point in the history
Grand.

Fixes #50
  • Loading branch information
PJB3005 committed Jan 14, 2024
1 parent 9e6b794 commit b6e5d0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SS14.Admin/Helpers/StatusMessageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void SetStatusInformation(this ITempDataDictionary tempData, strin
/// Possible types of status messages displayed.
/// </summary>
/// <seealso cref="StatusMessageHelper.SetStatusMessage"/>
public enum Type : byte
public enum Type
{
/// <summary>
/// Informational messages confirm successful actions to the user.
Expand Down
4 changes: 3 additions & 1 deletion SS14.Admin/Pages/Shared/StatusMessageAlert.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@using SS14.Admin.Helpers
@{
var statusMsg = (string?) TempData[StatusMessageHelper.KeyMessage];
var statusType = (StatusMessageHelper.Type?)TempData[StatusMessageHelper.KeyType];
StatusMessageHelper.Type? statusType = null;
if (TempData.TryGetValue(StatusMessageHelper.KeyType, out var statusTypeUncast) && statusTypeUncast != null)
statusType = (StatusMessageHelper.Type)statusTypeUncast;
}

@if (!string.IsNullOrWhiteSpace(statusMsg))
Expand Down

0 comments on commit b6e5d0c

Please sign in to comment.