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
|
@ -53,10 +53,10 @@ const LeftPanelLiveShareWarning: React.FC<Props> = ({ isMinimized }) => {
|
|||
() => OwnBeaconStore.instance.isMonitoringLiveLocation,
|
||||
);
|
||||
|
||||
const beaconIdsWithWireError = useEventEmitterState(
|
||||
const beaconIdsWithLocationPublishError = useEventEmitterState(
|
||||
OwnBeaconStore.instance,
|
||||
OwnBeaconStoreEvent.WireError,
|
||||
() => OwnBeaconStore.instance.getLiveBeaconIdsWithWireError(),
|
||||
OwnBeaconStoreEvent.LocationPublishError,
|
||||
() => OwnBeaconStore.instance.getLiveBeaconIdsWithLocationPublishError(),
|
||||
);
|
||||
|
||||
const liveBeaconIds = useEventEmitterState(
|
||||
|
@ -65,13 +65,13 @@ const LeftPanelLiveShareWarning: React.FC<Props> = ({ isMinimized }) => {
|
|||
() => OwnBeaconStore.instance.getLiveBeaconIds(),
|
||||
);
|
||||
|
||||
const hasWireErrors = !!beaconIdsWithWireError.length;
|
||||
const hasLocationPublishErrors = !!beaconIdsWithLocationPublishError.length;
|
||||
|
||||
if (!isMonitoringLiveLocation) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const relevantBeaconRoomId = chooseBestBeaconRoomId(liveBeaconIds, beaconIdsWithWireError);
|
||||
const relevantBeaconRoomId = chooseBestBeaconRoomId(liveBeaconIds, beaconIdsWithLocationPublishError);
|
||||
|
||||
const onWarningClick = relevantBeaconRoomId ? () => {
|
||||
dispatcher.dispatch<ViewRoomPayload>({
|
||||
|
@ -81,14 +81,14 @@ const LeftPanelLiveShareWarning: React.FC<Props> = ({ isMinimized }) => {
|
|||
});
|
||||
} : undefined;
|
||||
|
||||
const label = hasWireErrors ?
|
||||
const label = hasLocationPublishErrors ?
|
||||
_t('An error occured whilst sharing your live location') :
|
||||
_t('You are sharing your live location');
|
||||
|
||||
return <AccessibleButton
|
||||
className={classNames('mx_LeftPanelLiveShareWarning', {
|
||||
'mx_LeftPanelLiveShareWarning__minimized': isMinimized,
|
||||
'mx_LeftPanelLiveShareWarning__error': hasWireErrors,
|
||||
'mx_LeftPanelLiveShareWarning__error': hasLocationPublishErrors,
|
||||
})}
|
||||
title={isMinimized ? label : undefined}
|
||||
onClick={onWarningClick}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue