apply strictnullchecks to src/components/views/beacon/* (#10272)
This commit is contained in:
parent
ffa047be68
commit
de6a1a661c
11 changed files with 48 additions and 30 deletions
|
@ -27,11 +27,11 @@ interface Props {
|
|||
beacon: Beacon;
|
||||
}
|
||||
|
||||
const useBeaconName = (beacon: Beacon): string => {
|
||||
const useBeaconName = (beacon: Beacon): string | undefined => {
|
||||
const matrixClient = useContext(MatrixClientContext);
|
||||
|
||||
if (beacon.beaconInfo.assetType !== LocationAssetType.Self) {
|
||||
return beacon.beaconInfo.description;
|
||||
if (beacon.beaconInfo?.assetType !== LocationAssetType.Self) {
|
||||
return beacon.beaconInfo?.description;
|
||||
}
|
||||
const room = matrixClient.getRoom(beacon.roomId);
|
||||
const member = room?.getMember(beacon.beaconInfoOwner);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue