Live location sharing - update beacon tile with latest location (#8265)
* add useBeacon hook Signed-off-by: Kerry Archibald <kerrya@element.io> * update message tile types to work with function comp with ref Signed-off-by: Kerry Archibald <kerrya@element.io> * use beacon hook in beacon body Signed-off-by: Kerry Archibald <kerrya@element.io> * update beacon body with (textual) latest locations, test Signed-off-by: Kerry Archibald <kerrya@element.io> * language in comment Signed-off-by: Kerry Archibald <kerrya@element.io> * comments Signed-off-by: Kerry Archibald <kerrya@element.io> * copyright Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
7ba991cd8c
commit
aecd71ad15
9 changed files with 424 additions and 29 deletions
|
@ -125,7 +125,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient<OwnBeaconStoreState> {
|
|||
protected async onReady(): Promise<void> {
|
||||
this.matrixClient.on(BeaconEvent.LivenessChange, this.onBeaconLiveness);
|
||||
this.matrixClient.on(BeaconEvent.New, this.onNewBeacon);
|
||||
this.matrixClient.removeListener(BeaconEvent.Update, this.onUpdateBeacon);
|
||||
this.matrixClient.on(BeaconEvent.Update, this.onUpdateBeacon);
|
||||
this.matrixClient.on(RoomStateEvent.Members, this.onRoomStateMembers);
|
||||
|
||||
this.initialiseBeaconState();
|
||||
|
@ -213,6 +213,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient<OwnBeaconStoreState> {
|
|||
}
|
||||
|
||||
this.checkLiveness();
|
||||
beacon.monitorLiveness();
|
||||
};
|
||||
|
||||
private onBeaconLiveness = (isLive: boolean, beacon: Beacon): void => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue