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
|
@ -28,8 +28,8 @@ import StyledLiveBeaconIcon from './StyledLiveBeaconIcon';
|
|||
import { Icon as CloseIcon } from '../../../../res/img/image-view/close.svg';
|
||||
import LiveTimeRemaining from './LiveTimeRemaining';
|
||||
|
||||
const getLabel = (hasWireError: boolean, hasStopSharingError: boolean): string => {
|
||||
if (hasWireError) {
|
||||
const getLabel = (hasLocationPublishError: boolean, hasStopSharingError: boolean): string => {
|
||||
if (hasLocationPublishError) {
|
||||
return _t('An error occured whilst sharing your live location, please try again');
|
||||
}
|
||||
if (hasStopSharingError) {
|
||||
|
@ -45,22 +45,22 @@ interface RoomLiveShareWarningInnerProps {
|
|||
const RoomLiveShareWarningInner: React.FC<RoomLiveShareWarningInnerProps> = ({ liveBeaconIds, roomId }) => {
|
||||
const {
|
||||
onStopSharing,
|
||||
onResetWireError,
|
||||
onResetLocationPublishError,
|
||||
beacon,
|
||||
stoppingInProgress,
|
||||
hasStopSharingError,
|
||||
hasWireError,
|
||||
hasLocationPublishError,
|
||||
} = useOwnLiveBeacons(liveBeaconIds);
|
||||
|
||||
if (!beacon) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const hasError = hasStopSharingError || hasWireError;
|
||||
const hasError = hasStopSharingError || hasLocationPublishError;
|
||||
|
||||
const onButtonClick = () => {
|
||||
if (hasWireError) {
|
||||
onResetWireError();
|
||||
if (hasLocationPublishError) {
|
||||
onResetLocationPublishError();
|
||||
} else {
|
||||
onStopSharing();
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ const RoomLiveShareWarningInner: React.FC<RoomLiveShareWarningInnerProps> = ({ l
|
|||
<StyledLiveBeaconIcon className="mx_RoomLiveShareWarning_icon" withError={hasError} />
|
||||
|
||||
<span className="mx_RoomLiveShareWarning_label">
|
||||
{ getLabel(hasWireError, hasStopSharingError) }
|
||||
{ getLabel(hasLocationPublishError, hasStopSharingError) }
|
||||
</span>
|
||||
|
||||
{ stoppingInProgress &&
|
||||
|
@ -90,7 +90,7 @@ const RoomLiveShareWarningInner: React.FC<RoomLiveShareWarningInnerProps> = ({ l
|
|||
>
|
||||
{ hasError ? _t('Retry') : _t('Stop sharing') }
|
||||
</AccessibleButton>
|
||||
{ hasWireError && <AccessibleButton
|
||||
{ hasLocationPublishError && <AccessibleButton
|
||||
data-test-id='room-live-share-wire-error-close-button'
|
||||
title={_t('Stop sharing and close')}
|
||||
element='button'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue