mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 22:27:32 +00:00
chore(lint): keep the fixes within the lint ratchets
No promise in a condition, sequential awaits through a reduce instead of a loop, no non-null assertions or any in the new tests, an awaited act, one options object for a stop edit and a handled rejection for the offline copy.
This commit is contained in:
@@ -47,7 +47,7 @@ export function tripEventSink(addons: AddonsService, orm: MikroORM | undefined,
|
||||
return (tripId, event, meta) => {
|
||||
const addonId = tripAddonOfEvent(event);
|
||||
const before = queues.get(tripId);
|
||||
if (!addonId && !before) return deliver(tripId, event, meta);
|
||||
if (!addonId && before === undefined) return deliver(tripId, event, meta);
|
||||
const ask = () => (addonId ? addons.isEnabledForTrip(tripId, addonId) : Promise.resolve(true));
|
||||
const on = (orm && addonId ? withRequestContext(orm, ask) : ask()).catch(() => false);
|
||||
const queued = (before ?? Promise.resolve())
|
||||
|
||||
Reference in New Issue
Block a user