diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index c143a820..6985f875 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 0.8.2 - 2023.07.27.1418 + 2023.07.27.1551 BLAZAM False diff --git a/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor b/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor index d1725143..62b0d33b 100644 --- a/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor +++ b/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor @@ -90,7 +90,7 @@ { if (action.IsActionAppropriateForObject(objectMap.ObjectType)) { - if (!WorkingModel.ActionMap.Any(a => a.ObjectAction == action)) + if (!WorkingModel.ActionMap.Any(a => a.ObjectType==objectMap.ObjectType && a.ObjectAction == action)) { diff --git a/BLAZAMGui/UI/Settings/Permissions/PermissionMapEditor.razor b/BLAZAMGui/UI/Settings/Permissions/PermissionMapEditor.razor index dc81033e..fc000ed0 100644 --- a/BLAZAMGui/UI/Settings/Permissions/PermissionMapEditor.razor +++ b/BLAZAMGui/UI/Settings/Permissions/PermissionMapEditor.razor @@ -42,9 +42,9 @@ @pd } } - @if (_accessLevels != null) + @if (_map?.AccessLevels != null) { - @foreach (var al in _accessLevels) + @foreach (var al in _map.AccessLevels) { @al.Name } diff --git a/BLAZAMUpdate/ApplicationUpdate.cs b/BLAZAMUpdate/ApplicationUpdate.cs index 0dab07d8..b2637ca7 100644 --- a/BLAZAMUpdate/ApplicationUpdate.cs +++ b/BLAZAMUpdate/ApplicationUpdate.cs @@ -172,7 +172,8 @@ public async Task Prepare() public async Task Apply() { - cancellationTokenSource = new CancellationTokenSource(); + if (cancellationTokenSource == null || cancellationTokenSource.IsCancellationRequested) + cancellationTokenSource = new CancellationTokenSource(); OnUpdateStarted?.Invoke(); if (!await Prepare()) @@ -410,7 +411,7 @@ public async Task Stage() } public void Cancel() { - cancellationTokenSource.Cancel(); + cancellationTokenSource?.Cancel(); } public async Task Download() { @@ -447,7 +448,7 @@ public async Task Download() while ((bytesRead = await streamToReadFrom.ReadAsync(buffer, 0, buffer.Length)) > 0) { - if (cancellationTokenSource?.IsCancellationRequested!=true) + if (cancellationTokenSource?.IsCancellationRequested != true) { await streamToWriteTo.WriteAsync(buffer, 0, bytesRead); totalBytesRead += bytesRead;