diff --git a/PizzaBot/Components/GlobalMessages.razor b/PizzaBot/Components/GlobalMessages.razor index eea9d0c..a55cdcf 100644 --- a/PizzaBot/Components/GlobalMessages.razor +++ b/PizzaBot/Components/GlobalMessages.razor @@ -1,5 +1,4 @@ @inject GlobalStuffService GlobalStuffService -@rendermode InteractiveServer @if (GlobalStuffService.OrdersLocked) { @@ -10,19 +9,3 @@

@GlobalStuffService.Message

} - -@code{ - protected override void OnInitialized() - { - EventHandler Reload = async (sender, eventArgs) => - { - await InvokeAsync(StateHasChanged); - }; - GlobalStuffService.OnLockOrMessageChange += Reload; - } - - - void ReloadState(){ - StateHasChanged(); - } -} diff --git a/PizzaBot/Services/GlobalStuffService.cs b/PizzaBot/Services/GlobalStuffService.cs index a2ab5f3..ae69ddf 100644 --- a/PizzaBot/Services/GlobalStuffService.cs +++ b/PizzaBot/Services/GlobalStuffService.cs @@ -11,7 +11,6 @@ namespace PizzaBot.Services private bool _ordersLocked; public readonly string LOCKED_ORDERS_MESSAGE = "Orders have been locked. Pizza will be ordered soon."; - public event EventHandler OnLockOrMessageChange; public int MeatPizzas { get; set; } public int VeggiePizzas { get; set; } public int VeganPizzas { get; set; } @@ -33,7 +32,6 @@ namespace PizzaBot.Services public void SetMessage(string message) { _message = message; - OnLockOrMessageChange(this, null); } public void SetOrdersLocked(bool ordersLocked) @@ -41,7 +39,6 @@ namespace PizzaBot.Services _ordersLocked = ordersLocked; ShouldBalance = true; - OnLockOrMessageChange(this, null); } public PizzaConfig? GetConfig()