Skip to content

Commit

Permalink
[Tizen] Fix BlazorWebView build error (dotnet#355)
Browse files Browse the repository at this point in the history
* [Tizen] Fix BlazorWebView build error

* [Tizen] Update tizen handler
  • Loading branch information
shyunMin authored and rookiejava committed Jan 27, 2022
1 parent 53c4ed6 commit e3d92c4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/BlazorWebView/src/Maui/Tizen/BlazorWebViewHandler.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ private void StartWebViewCoreIfPossible()
var contentRootDir = Path.GetDirectoryName(HostPage!) ?? string.Empty;
var hostPageRelativePath = Path.GetRelativePath(contentRootDir, HostPage!);

var customFileProvider = VirtualView.CreateFileProvider(contentRootDir);
var mauiAssetFileProvider = new TizenMauiAssetFileProvider(contentRootDir);
IFileProvider fileProvider = customFileProvider == null
? mauiAssetFileProvider
: new CompositeFileProvider(customFileProvider, mauiAssetFileProvider);
var fileProvider = VirtualView.CreateFileProvider(contentRootDir);

_webviewManager = new TizenWebViewManager(this, NativeWebView, Services!, ComponentsDispatcher, fileProvider, VirtualView.JSComponents, hostPageRelativePath);
if (RootComponents != null)
Expand Down Expand Up @@ -161,5 +157,11 @@ private void OnLoadFinished(object? sender, EventArgs e)
if (url == AppOrigin)
NativeWebView.Eval(BlazorInitScript);
}

internal IFileProvider CreateFileProvider(string contentRootDir)
{
return new TizenMauiAssetFileProvider(contentRootDir);
}

}
}

0 comments on commit e3d92c4

Please sign in to comment.