diff --git a/PersonalWebsite/Components/TerminalCommands.razor b/PersonalWebsite/Components/TerminalCommands.razor index 262f213..b5c236a 100644 --- a/PersonalWebsite/Components/TerminalCommands.razor +++ b/PersonalWebsite/Components/TerminalCommands.razor @@ -1,19 +1,18 @@ @if (CurrentState is State.Waiting) { } @@ -39,11 +38,6 @@ else @code { - private readonly System.Timers.Timer _timer = new() - { - Interval = 5_000 - }; - private State CurrentState { get; set; } = State.Waiting; private bool IsTyping { get; set; } @@ -58,20 +52,14 @@ else [Parameter] public EventCallback OnComplete { get; set; } - protected override void OnInitialized() - { - _timer.Elapsed += TriggerInstructions; - _timer.Start(); - } - - private void TriggerInstructions(object? o, EventArgs e) + protected override async Task OnAfterRenderAsync(bool firstRender) { - _timer.Stop(); - _timer.Elapsed -= TriggerInstructions; - _timer.Dispose(); - - ShowInstructions = true; - StateHasChanged(); + if (firstRender) + { + await Task.Delay(1500); + ShowInstructions = true; + StateHasChanged(); + } } private async Task OnCommandCompleted()