Add widget actions for joining and leaving calls and switching layouts

These actions are processed lazily to ensure that even if the app takes a while to start up, they won't be missed.
This commit is contained in:
Robin Townsend
2022-09-09 02:10:45 -04:00
parent f0045c9406
commit b7be3011da
4 changed files with 141 additions and 36 deletions

View File

@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React, { FC, useEffect, useState } from "react";
import React, { FC, useEffect, useState, useCallback } from "react";
import type { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall";
import { useClient } from "../ClientContext";
import { ErrorView, LoadingView } from "../FullScreenView";
import { RoomAuthView } from "./RoomAuthView";
@@ -34,6 +35,7 @@ export const RoomPage: FC = () => {
roomId,
viaServers,
isEmbedded,
preload,
hideHeader,
isPtt,
displayName,
@@ -68,10 +70,11 @@ export const RoomPage: FC = () => {
groupCall={groupCall}
isPasswordlessUser={isPasswordlessUser}
isEmbedded={isEmbedded}
preload={preload}
hideHeader={hideHeader}
/>
),
[client, roomIdOrAlias, isPasswordlessUser, isEmbedded, hideHeader]
[client, roomIdOrAlias, isPasswordlessUser, isEmbedded, preload, hideHeader]
);
if (loading || isRegistering) {