Skip to content

Commit

Permalink
Fix cache filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebaltazar committed Feb 24, 2024
1 parent d25bb3c commit a566451
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Maui.ServerDrivenUI/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static MauiAppBuilder ConfigureServerDrivenUI(this MauiAppBuilder builder
builder.Services.AddEasyCaching(o =>
o.UseLiteDB(c => ConfigureDb(c, settings)));

builder.ConfigureLifecycleEvents(b =>
{
builder.ConfigureLifecycleEvents(b => {
#if IOS
b.AddiOS(iOS => iOS.FinishedLaunching((app, launchOptions) => InitServerDrivenUIService()));
#elif ANDROID
Expand All @@ -39,7 +38,7 @@ public static MauiAppBuilder ConfigureServerDrivenUI(this MauiAppBuilder builder
private static void ConfigureDb(LiteDBOptions config, ServerDrivenUISettings settings)
{
var dbFilePath = settings.CacheFilePath
?? FileSystem.Current.AppDataDirectory + "sduicache.ldb";
?? Path.Combine(FileSystem.Current.AppDataDirectory, "sduicache.ldb");

config.DBConfig = new LiteDBDBOptions {
FileName = dbFilePath,
Expand Down

0 comments on commit a566451

Please sign in to comment.