diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor index 9184314d62..98d772aa26 100644 --- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor +++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor @@ -29,10 +29,6 @@
- -
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs index d0e8d54536..9a9362c5c7 100644 --- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs +++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs @@ -42,8 +42,6 @@ public MonacoEditor(IJSRuntime? jsRuntime = null, string? id = null, string? @cl [Parameter] public UITextLineNumber? LineNumberMode { get; set; } - private bool ShowLoading { get; set; } - protected override void OnInitialized() { base.OnInitialized(); @@ -67,8 +65,6 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { - InvokeAsync(DisplayLoadingIfSlowLoadingAsync).Forget(); - // Get desired options StandaloneEditorConstructionOptions options = ConstructionOptions?.Invoke(this) ?? new(); @@ -145,7 +141,6 @@ protected override void OnEditorLoaded() lock (_lock) { _isLoaded = true; - ShowLoading = false; if (SettingsProvider is not null) { @@ -190,27 +185,6 @@ private string GetTheme() return _themeListener.ActualAppTheme == ApplicationTheme.Dark ? BuiltinTheme.VsDark : BuiltinTheme.Vs; } - private async Task DisplayLoadingIfSlowLoadingAsync() - { - // Let's not show the progress ring during the first 100ms. We know customers tends to perceive anything - // faster than 100ms as "instant", so no need to bother the user with a very shortly displayed progress ring - // if we succeed to load within 100ms. - // https://psychology.stackexchange.com/questions/1664/what-is-the-threshold-where-actions-are-perceived-as-instant - - const int Delay = 100; - - await Task.Delay(Delay); - - lock (_lock) - { - if (!_isLoaded) - { - ShowLoading = true; - StateHasChanged(); - } - } - } - private void ApplyWordWrapOption(EditorOptions editorOptions) { switch (WrapMode) diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor index fb1e30ec19..261f05d9be 100644 --- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor +++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor @@ -29,10 +29,6 @@
- -
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor.cs index 2e175e1dbf..4520eb9436 100644 --- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor.cs +++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorDiff.razor.cs @@ -6,7 +6,6 @@ namespace DevToys.Blazor.Components; public partial class MonacoEditorDiff : RicherMonacoEditorDiffBase { private readonly object _lock = new(); - private bool _isLoaded; private bool _oldIsActuallyEnabled; private bool _oldReadOnlyState; @@ -21,8 +20,6 @@ public partial class MonacoEditorDiff : RicherMonacoEditorDiffBase [Parameter] public Func? ConstructionOptions { get; set; } - private bool ShowLoading { get; set; } - protected override void OnInitialized() { base.OnInitialized(); @@ -39,8 +36,6 @@ protected override async Task OnAfterRenderAsync(bool firstRender) Guard.IsNull(OriginalEditor); Guard.IsNull(ModifiedEditor); - InvokeAsync(DisplayLoadingIfSlowLoadingAsync).Forget(); - // Get desired options StandaloneDiffEditorConstructionOptions options = ConstructionOptions?.Invoke(this) ?? new(); @@ -133,8 +128,6 @@ protected override void OnEditorLoaded() base.OnEditorLoaded(); lock (_lock) { - _isLoaded = true; - ShowLoading = false; StateHasChanged(); } } @@ -163,25 +156,4 @@ private string GetTheme() Guard.IsNotNull(_themeListener); return _themeListener.ActualAppTheme == ApplicationTheme.Dark ? BuiltinTheme.VsDark : BuiltinTheme.Vs; } - - private async Task DisplayLoadingIfSlowLoadingAsync() - { - // Let's not show the progress ring during the first 100ms. We know customers tends to perceive anything - // faster than 100ms as "instant", so no need to bother the user with a very shortly displayed progress ring - // if we succeed to load within 100ms. - // https://psychology.stackexchange.com/questions/1664/what-is-the-threshold-where-actions-are-perceived-as-instant - - const int Delay = 100; - - await Task.Delay(Delay); - - lock (_lock) - { - if (!_isLoaded) - { - ShowLoading = true; - StateHasChanged(); - } - } - } }