Skip to content

Commit

Permalink
fix(hrui): Fix double flicker + double notif on wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Jul 15, 2024
1 parent a29c5ea commit 3590121
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public static void ForceHotReloadUpdate()
try
{
Instance?._status.ConfigureSourceForNextOperation(HotReloadSource.Manual);
UpdateApplication(Array.Empty<Type>());
UpdateApplicationCore([]);
}
finally
{
Expand All @@ -446,6 +446,18 @@ public static void ForceHotReloadUpdate()
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static void UpdateApplication(Type[] types)
{
if (types is { Length: >0 })
{
UpdateApplicationCore(types);
}
else
{
_log.Trace("Invalid metadata update, ignore it."); // Avoid flicker on WASM
}
}

private static void UpdateApplicationCore(Type[] types)
{
var hr = Instance?._status.ReportLocalStarting(types);

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

<PropertyGroup>
<_OverrideTargetFramework>$(TargetFramework)</_OverrideTargetFramework>
<_TargetNugetFolder>$(NuGetPackageRoot)\$(PackageId.ToLowerInvariant())\$(UnoNugetOverrideVersion)\uno-runtime\$(UnoRuntimeIdentifier.ToLowerInvariant())</_TargetNugetFolder>
<_TargetNugetFolder>$(NuGetPackageRoot)\$(PackageId.ToLowerInvariant())\$(UnoNugetOverrideVersion)\uno-runtime\$(TargetFramework)\$(UnoRuntimeIdentifier.ToLowerInvariant())</_TargetNugetFolder>
</PropertyGroup>
<ItemGroup>
<_OutputFiles Include="$(TargetDir)**" />
Expand Down
5 changes: 5 additions & 0 deletions src/Uno.UI/WasmCSS/Uno.UI.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,8 @@ input::-ms-clear {
background: var(--selection-background);
color: var(--selection-color);
}

/* Uno has it's own HR indicator, hide default indicator from dotnet. */
#dotnet-hotreload-toast {
visibility: collapse
}

0 comments on commit 3590121

Please sign in to comment.