Skip to content

Commit

Permalink
Fix shared shocker live control
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Jan 26, 2024
1 parent e47ecc3 commit bc8dbcf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions LiveControlGateway/Controllers/LiveControlController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public async Task UpdatePermissions(OpenShockContext db)
});
return;
}



_sharedShockers = await db.ShockerShares
.Where(x => x.Shocker.Device == Id && x.SharedWith == _currentUser.DbUser.Id).ToDictionaryAsync(
x => x.ShockerId, x => new LiveShockerPermission()
.Where(x => x.Shocker.Device == Id && x.SharedWith == _currentUser.DbUser.Id).Select(x => new
{
x.ShockerId,
Lsp = new LiveShockerPermission
{
Paused = x.Paused || x.Shocker.Paused,
Paused = x.Paused,
PermsAndLimits = new SharePermsAndLimitsLive
{
Shock = x.PermShock,
Expand All @@ -114,7 +114,8 @@ public async Task UpdatePermissions(OpenShockContext db)
Intensity = x.LimitIntensity,
Live = x.PermLive
}
});
}
}).ToDictionaryAsync(x => x.ShockerId, x => x.Lsp);
}

/// <summary>
Expand Down

0 comments on commit bc8dbcf

Please sign in to comment.