mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-04 21:35:19 +00:00
move show footer logic to callViewModel
Also remove header prop. This is accesible via urlParams.
This commit is contained in:
@@ -14,11 +14,13 @@ import {
|
||||
type RTCNotificationType,
|
||||
} from "matrix-js-sdk/lib/matrixrtc";
|
||||
import { pickBy } from "lodash-es";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
|
||||
import { Config } from "./config/Config";
|
||||
import { type EncryptionSystem } from "./e2ee/sharedKeyManagement";
|
||||
import { E2eeType } from "./e2ee/e2eeType";
|
||||
import { platform } from "./Platform";
|
||||
import { type ObservableScope } from "./state/ObservableScope";
|
||||
|
||||
interface RoomIdentifier {
|
||||
roomAlias: string | null;
|
||||
@@ -607,6 +609,24 @@ export const useRoomIdentifier = (): RoomIdentifier => {
|
||||
);
|
||||
};
|
||||
|
||||
let urlParams$ = undefined as BehaviorSubject<UrlParams> | undefined;
|
||||
export const observerUrlParams$ = (
|
||||
scope: ObservableScope,
|
||||
): BehaviorSubject<UrlParams> => {
|
||||
if (urlParams$ !== undefined) return urlParams$;
|
||||
function updateUrlParams(): void {
|
||||
console.log("[observerUrlParams$] update urlParams$");
|
||||
urlParams$!.next(getUrlParams());
|
||||
}
|
||||
|
||||
urlParams$ = new BehaviorSubject(getUrlParams());
|
||||
window.addEventListener("hashchange", updateUrlParams);
|
||||
scope.onEnd(() => {
|
||||
window.removeEventListener("hashchange", updateUrlParams);
|
||||
});
|
||||
return urlParams$;
|
||||
};
|
||||
|
||||
export function generateUrlSearchParams(
|
||||
roomId: string,
|
||||
encryptionSystem: EncryptionSystem,
|
||||
|
||||
Reference in New Issue
Block a user