Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created December 30, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arturaz/ba251b7fa540c28f85dcff38c7b47c07 to your computer and use it in GitHub Desktop.
Save arturaz/ba251b7fa540c28f85dcff38c7b47c07 to your computer and use it in GitHub Desktop.
for (final kv in accounts.entries) {
kv.value.details.owner.iswitch(
me: () {},
otherUser: (userId) {
otherUsers
.getE(userId)
.fold((err) => errors.add(StateUpdateError.withoutEvent(err)),
(events) {
final accountId = kv.key;
if (!events.share.rules.isShared(accountId)) {
final maybeError = moveAccountToNotShared(accountId);
if (maybeError.isSome)
errors.add(
StateUpdateError.withoutEvent(maybeError.getOrThrow));
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment