Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions JournalApp/Data/BackupFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public class BackupFile
/// </summary>
public static async Task<BackupFile> ReadArchive(Stream stream)
{
using var archive = new ZipArchive(stream, ZipArchiveMode.Read);
await using var archive = await ZipArchive.CreateAsync(stream, ZipArchiveMode.Read, leaveOpen: true, entryNameEncoding: null);

foreach (var entry in archive.Entries)
{
if (entry.FullName == InternalBackupFileName)
{
await using var entryStream = entry.Open();
await using var entryStream = await entry.OpenAsync();

return await JsonSerializer.DeserializeAsync<BackupFile>(entryStream, SerializerOptions);
}
Expand All @@ -60,10 +60,10 @@ public static async Task<BackupFile> ReadArchive(string path)
/// </summary>
public async Task WriteArchive(Stream stream)
{
using var archive = new ZipArchive(stream, ZipArchiveMode.Create);
await using var archive = await ZipArchive.CreateAsync(stream, ZipArchiveMode.Create, leaveOpen: true, entryNameEncoding: null);

var entry = archive.CreateEntry(InternalBackupFileName);
await using var entryStream = entry.Open();
await using var entryStream = await entry.OpenAsync();

await JsonSerializer.SerializeAsync(entryStream, this, SerializerOptions);
}
Expand Down
3 changes: 3 additions & 0 deletions JournalApp/Pages/SettingsPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@* TODO: Replace with separate page so we can change state of inline fields and have it updated properly in settings *@
<div class="loading-container">
<MudProgressCircular Class="loading-spinner" Color="Color.Primary" Indeterminate />
<MudText Typo="Typo.body2" Align="Align.Center" Class="loading-warning">Please do not close the app</MudText>
</div>
}
else
Expand Down Expand Up @@ -177,6 +178,7 @@ else
{
_busy = true;
StateHasChanged();
await Task.Yield();

var path = App.ActivatedFilePath;

Expand All @@ -195,6 +197,7 @@ else
{
_busy = true;
StateHasChanged();
await Task.Yield();

await AppDataUIService.StartExportWizard(DialogService);
}
Expand Down
7 changes: 7 additions & 0 deletions JournalApp/Pages/SettingsPage.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

Expand All @@ -21,3 +23,8 @@
width: 33vw;
margin-top: 10vh;
}

.loading-warning {
margin-top: 24px;
opacity: 0.7;
}
Loading