Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -43,15 +43,13 @@ export const useOwnLiveBeacons = (liveBeaconIds: BeaconIdentifier[]): LiveBeacon
const hasLocationPublishError = useEventEmitterState(
OwnBeaconStore.instance,
OwnBeaconStoreEvent.LocationPublishError,
() =>
liveBeaconIds.some(OwnBeaconStore.instance.beaconHasLocationPublishError),
() => liveBeaconIds.some(OwnBeaconStore.instance.beaconHasLocationPublishError),
);
const hasStopSharingError = useEventEmitterState(
OwnBeaconStore.instance,
OwnBeaconStoreEvent.BeaconUpdateError,
() =>
liveBeaconIds.some(id => OwnBeaconStore.instance.beaconUpdateErrors.has(id)),
() => liveBeaconIds.some((id) => OwnBeaconStore.instance.beaconUpdateErrors.has(id)),
);
useEffect(() => {
@ -66,21 +64,22 @@ export const useOwnLiveBeacons = (liveBeaconIds: BeaconIdentifier[]): LiveBeacon
}, [liveBeaconIds]);
// select the beacon with latest expiry to display expiry time
const beacon = liveBeaconIds.map(beaconId => OwnBeaconStore.instance.getBeaconById(beaconId))
const beacon = liveBeaconIds
.map((beaconId) => OwnBeaconStore.instance.getBeaconById(beaconId))
.sort(sortBeaconsByLatestExpiry)
.shift();
const onStopSharing = async () => {
setStoppingInProgress(true);
try {
await Promise.all(liveBeaconIds.map(beaconId => OwnBeaconStore.instance.stopBeacon(beaconId)));
await Promise.all(liveBeaconIds.map((beaconId) => OwnBeaconStore.instance.stopBeacon(beaconId)));
} catch (error) {
setStoppingInProgress(false);
}
};
const onResetLocationPublishError = () => {
liveBeaconIds.forEach(beaconId => {
liveBeaconIds.forEach((beaconId) => {
OwnBeaconStore.instance.resetLocationPublishError(beaconId);
});
};