LLS: rename wireError (#8401)
* rename wireError in ownbeaconstore to locationPublishError Signed-off-by: Kerry Archibald <kerrya@element.io> * rename getLiveBeaconIdsWithWireError -> getLiveBeaconIdsWithLocationPublishError Signed-off-by: Kerry Archibald <kerrya@element.io> * rename wire error variables in components Signed-off-by: Kerry Archibald <kerrya@element.io> * new snapshots for new test names Signed-off-by: Kerry Archibald <kerrya@element.io> * fix bad capitalisation on onResetLocationPublishError Signed-off-by: Kerry Archibald <kerrya@element.io> * missed variable Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
a3f9123f6c
commit
8c6786bad6
11 changed files with 133 additions and 120 deletions
|
@ -24,10 +24,10 @@ import { sortBeaconsByLatestExpiry } from "./duration";
|
|||
type LiveBeaconsState = {
|
||||
beacon?: Beacon;
|
||||
onStopSharing?: () => void;
|
||||
onResetWireError?: () => void;
|
||||
onResetLocationPublishError?: () => void;
|
||||
stoppingInProgress?: boolean;
|
||||
hasStopSharingError?: boolean;
|
||||
hasWireError?: boolean;
|
||||
hasLocationPublishError?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -41,11 +41,11 @@ export const useOwnLiveBeacons = (liveBeaconIds: BeaconIdentifier[]): LiveBeacon
|
|||
const [stoppingInProgress, setStoppingInProgress] = useState(false);
|
||||
const [error, setError] = useState<Error>();
|
||||
|
||||
const hasWireError = useEventEmitterState(
|
||||
const hasLocationPublishError = useEventEmitterState(
|
||||
OwnBeaconStore.instance,
|
||||
OwnBeaconStoreEvent.WireError,
|
||||
OwnBeaconStoreEvent.LocationPublishError,
|
||||
() =>
|
||||
liveBeaconIds.some(OwnBeaconStore.instance.beaconHasWireError),
|
||||
liveBeaconIds.some(OwnBeaconStore.instance.beaconHasLocationPublishError),
|
||||
);
|
||||
|
||||
// reset stopping in progress on change in live ids
|
||||
|
@ -72,16 +72,16 @@ export const useOwnLiveBeacons = (liveBeaconIds: BeaconIdentifier[]): LiveBeacon
|
|||
}
|
||||
};
|
||||
|
||||
const onResetWireError = () => {
|
||||
liveBeaconIds.map(beaconId => OwnBeaconStore.instance.resetWireError(beaconId));
|
||||
const onResetLocationPublishError = () => {
|
||||
liveBeaconIds.map(beaconId => OwnBeaconStore.instance.resetLocationPublishError(beaconId));
|
||||
};
|
||||
|
||||
return {
|
||||
onStopSharing,
|
||||
onResetWireError,
|
||||
onResetLocationPublishError,
|
||||
beacon,
|
||||
stoppingInProgress,
|
||||
hasWireError,
|
||||
hasLocationPublishError,
|
||||
hasStopSharingError: !!error,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue