Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for only being able to apply an action to one object type #129

Merged
merged 1 commit into from
Jul 27, 2023
Merged
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
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
Loading