feat: public/private lookup flags, consistency

This commit is contained in:
spiral
2021-12-06 00:32:54 -05:00
parent aacf5909a9
commit 455830a2b5
16 changed files with 44 additions and 40 deletions

View File

@@ -50,7 +50,7 @@ public class Switch
// Make sure the requested switch isn't identical to the last one
if (await lastSwitchMembers.Select(m => m.Id)
.SequenceEqualAsync(members.Select(m => m.Id).ToAsyncEnumerable()))
throw Errors.SameSwitch(members, ctx.LookupContextFor(ctx.System));
throw Errors.SameSwitch(members, ctx.LookupContextFor(ctx.System.Id));
}
await _repo.AddSwitch(conn, ctx.System.Id, members.Select(m => m.Id).ToList());
@@ -138,7 +138,7 @@ public class Switch
// Make sure switch isn't being edited to have the members it already does
if (await lastSwitchMembers.Select(m => m.Id)
.SequenceEqualAsync(members.Select(m => m.Id).ToAsyncEnumerable()))
throw Errors.SameSwitch(members, ctx.LookupContextFor(ctx.System));
throw Errors.SameSwitch(members, ctx.LookupContextFor(ctx.System.Id));
// Send a prompt asking the user to confirm the switch
var lastSwitchDeltaStr = (SystemClock.Instance.GetCurrentInstant() - lastSwitch.Timestamp).FormatDuration();