Hide screenshare button in video rooms on Desktop (#9045)
* Hide screenshare button in video rooms on Desktop * Fix tests
This commit is contained in:
parent
e576347b62
commit
4dd74261b5
3 changed files with 11 additions and 1 deletions
|
@ -288,6 +288,10 @@ export default abstract class BasePlatform {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public supportsJitsiScreensharing(): boolean {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public overrideBrowserShortcuts(): boolean {
|
public overrideBrowserShortcuts(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import { CallType } from "matrix-js-sdk/src/webrtc/call";
|
||||||
import { randomString, randomLowercaseString, randomUppercaseString } from "matrix-js-sdk/src/randomstring";
|
import { randomString, randomLowercaseString, randomUppercaseString } from "matrix-js-sdk/src/randomstring";
|
||||||
|
|
||||||
import { MatrixClientPeg } from '../MatrixClientPeg';
|
import { MatrixClientPeg } from '../MatrixClientPeg';
|
||||||
|
import PlatformPeg from '../PlatformPeg';
|
||||||
import SdkConfig from "../SdkConfig";
|
import SdkConfig from "../SdkConfig";
|
||||||
import dis from '../dispatcher/dispatcher';
|
import dis from '../dispatcher/dispatcher';
|
||||||
import WidgetEchoStore from '../stores/WidgetEchoStore';
|
import WidgetEchoStore from '../stores/WidgetEchoStore';
|
||||||
|
@ -510,6 +511,7 @@ export default class WidgetUtils {
|
||||||
'roomId=$matrix_room_id',
|
'roomId=$matrix_room_id',
|
||||||
'theme=$theme',
|
'theme=$theme',
|
||||||
'roomName=$roomName',
|
'roomName=$roomName',
|
||||||
|
`supportsScreensharing=${PlatformPeg.get().supportsJitsiScreensharing()}`,
|
||||||
];
|
];
|
||||||
if (opts.auth) {
|
if (opts.auth) {
|
||||||
queryStringParts.push(`auth=${opts.auth}`);
|
queryStringParts.push(`auth=${opts.auth}`);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||||
import { IDevice } from "matrix-js-sdk/src/crypto/deviceinfo";
|
import { IDevice } from "matrix-js-sdk/src/crypto/deviceinfo";
|
||||||
import { RoomType } from "matrix-js-sdk/src/@types/event";
|
import { RoomType } from "matrix-js-sdk/src/@types/event";
|
||||||
|
|
||||||
import { stubClient, setupAsyncStoreWithClient } from "./test-utils";
|
import { stubClient, setupAsyncStoreWithClient, mockPlatformPeg } from "./test-utils";
|
||||||
import { MatrixClientPeg } from "../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../src/MatrixClientPeg";
|
||||||
import WidgetStore from "../src/stores/WidgetStore";
|
import WidgetStore from "../src/stores/WidgetStore";
|
||||||
import WidgetUtils from "../src/utils/WidgetUtils";
|
import WidgetUtils from "../src/utils/WidgetUtils";
|
||||||
|
@ -27,12 +27,16 @@ import { VIDEO_CHANNEL_MEMBER } from "../src/utils/VideoChannelUtils";
|
||||||
import createRoom, { canEncryptToAllUsers } from '../src/createRoom';
|
import createRoom, { canEncryptToAllUsers } from '../src/createRoom';
|
||||||
|
|
||||||
describe("createRoom", () => {
|
describe("createRoom", () => {
|
||||||
|
mockPlatformPeg();
|
||||||
|
|
||||||
let client: MatrixClient;
|
let client: MatrixClient;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
stubClient();
|
stubClient();
|
||||||
client = MatrixClientPeg.get();
|
client = MatrixClientPeg.get();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(() => jest.clearAllMocks());
|
||||||
|
|
||||||
it("sets up video rooms correctly", async () => {
|
it("sets up video rooms correctly", async () => {
|
||||||
setupAsyncStoreWithClient(WidgetStore.instance, client);
|
setupAsyncStoreWithClient(WidgetStore.instance, client);
|
||||||
jest.spyOn(WidgetUtils, "waitForRoomWidget").mockResolvedValue();
|
jest.spyOn(WidgetUtils, "waitForRoomWidget").mockResolvedValue();
|
||||||
|
|
Loading…
Reference in a new issue