Goal: Be able to remove the line from CharacterSheet.razor that returns early if Character is null.
Character.Empty() was intended to allow components to start rendering and stuff while waiting for load. However, because the Coins events are part of the model rather than part of SheetJank, components initialize by subscribing for changes on the character object created by Character.Empty().
Likely instead need to override OnParametersSet() and check if the Character.Id changes. If it does, then unsubscribe from the old events on the empty character and subscribe to the events on the real character.
Goal: Be able to remove the line from
CharacterSheet.razor
that returns early ifCharacter
isnull
.Character.Empty()
was intended to allow components to start rendering and stuff while waiting for load. However, because the Coins events are part of the model rather than part ofSheetJank
, components initialize by subscribing for changes on the character object created byCharacter.Empty()
.Likely instead need to override
OnParametersSet()
and check if theCharacter.Id
changes. If it does, then unsubscribe from the old events on the empty character and subscribe to the events on the real character.