Skip to content

Commit

Permalink
Merge pull request #129 from Blazam-App/Beta-Dev
Browse files Browse the repository at this point in the history
Fix for only being able to apply an action to one object type
  • Loading branch information
jacobsen9026 authored Jul 27, 2023
2 parents 3f8a04e + 470929f commit 0c36d95
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.8.2</AssemblyVersion>
<Version>2023.07.27.1418</Version>
<Version>2023.07.27.1551</Version>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>

Expand Down
2 changes: 1 addition & 1 deletion BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{


Expand Down
4 changes: 2 additions & 2 deletions BLAZAMGui/UI/Settings/Permissions/PermissionMapEditor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<MudButton Disabled Color="Color.Secondary">@pd</MudButton>
}
}
@if (_accessLevels != null)
@if (_map?.AccessLevels != null)
{
@foreach (var al in _accessLevels)
@foreach (var al in _map.AccessLevels)
{
<MudButton Disabled Color="Color.Secondary">@al.Name</MudButton>
}
Expand Down
7 changes: 4 additions & 3 deletions BLAZAMUpdate/ApplicationUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ public async Task<bool> Prepare()

public async Task<string> Apply()
{
cancellationTokenSource = new CancellationTokenSource();
if (cancellationTokenSource == null || cancellationTokenSource.IsCancellationRequested)
cancellationTokenSource = new CancellationTokenSource();

OnUpdateStarted?.Invoke();
if (!await Prepare())
Expand Down Expand Up @@ -410,7 +411,7 @@ public async Task<bool> Stage()
}
public void Cancel()
{
cancellationTokenSource.Cancel();
cancellationTokenSource?.Cancel();
}
public async Task<bool> Download()
{
Expand Down Expand Up @@ -447,7 +448,7 @@ public async Task<bool> 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;
Expand Down

0 comments on commit 0c36d95

Please sign in to comment.