Skip to content

Commit 9a9e560

Browse files
committed
Change text for default response.
1 parent 5e873a4 commit 9a9e560

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Demo/ExpireStorage.Demo.PWA/Models/StorageSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ public class StorageSettings
55
public string Key { get; set; } = "StorageKey";
66
public int LocalStorageDaysInFuture { get; set; } = 7;
77
public int SessionStorageMinutesInFuture { get; set; } = 10;
8-
public int ResponseDelayInMs { get; set; } = 0;
9-
public bool MockOffline { get; set; } = false;
8+
public int ResponseDelayInMs { get; set; } = 500;
9+
public bool MockOffline { get; set; }
1010
}

Demo/ExpireStorage.Demo.PWA/Pages/Home.razor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private async Task Save()
3838
var value = await StorageService.CachedRequestAsync(_storageSettings.Key,
3939
async () => await FunctionToCall(),
4040
_cachedRequest,
41-
new DemoModelForStorage(),
41+
new DemoModelForStorage { Data = "Default object returned." },
4242
_cls.Token);
4343
_response = value?.Data ?? "No data";
4444
_handledBy = value?.HandledBy ?? HandledBy.None;
@@ -52,16 +52,15 @@ private async Task<DemoModelForStorage> FunctionToCall()
5252
{
5353
await Task.Delay(_storageSettings.ResponseDelayInMs);
5454
}
55-
55+
5656
if (_storageSettings.MockOffline)
5757
{
5858
throw new HttpRequestException("Mock offline");
5959
}
6060

6161
return _model;
6262
}
63-
64-
63+
6564
private Task OfflineChanged(bool newValue)
6665
{
6766
_isOffline = newValue;

0 commit comments

Comments
 (0)