Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 4dd7426

Browse files
authored
Hide screenshare button in video rooms on Desktop (#9045)
* Hide screenshare button in video rooms on Desktop * Fix tests
1 parent e576347 commit 4dd7426

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/BasePlatform.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ export default abstract class BasePlatform {
288288
return false;
289289
}
290290

291+
public supportsJitsiScreensharing(): boolean {
292+
return true;
293+
}
294+
291295
public overrideBrowserShortcuts(): boolean {
292296
return false;
293297
}

src/utils/WidgetUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { CallType } from "matrix-js-sdk/src/webrtc/call";
2626
import { randomString, randomLowercaseString, randomUppercaseString } from "matrix-js-sdk/src/randomstring";
2727

2828
import { MatrixClientPeg } from '../MatrixClientPeg';
29+
import PlatformPeg from '../PlatformPeg';
2930
import SdkConfig from "../SdkConfig";
3031
import dis from '../dispatcher/dispatcher';
3132
import WidgetEchoStore from '../stores/WidgetEchoStore';
@@ -510,6 +511,7 @@ export default class WidgetUtils {
510511
'roomId=$matrix_room_id',
511512
'theme=$theme',
512513
'roomName=$roomName',
514+
`supportsScreensharing=${PlatformPeg.get().supportsJitsiScreensharing()}`,
513515
];
514516
if (opts.auth) {
515517
queryStringParts.push(`auth=${opts.auth}`);

test/createRoom-test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,24 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix";
1919
import { IDevice } from "matrix-js-sdk/src/crypto/deviceinfo";
2020
import { RoomType } from "matrix-js-sdk/src/@types/event";
2121

22-
import { stubClient, setupAsyncStoreWithClient } from "./test-utils";
22+
import { stubClient, setupAsyncStoreWithClient, mockPlatformPeg } from "./test-utils";
2323
import { MatrixClientPeg } from "../src/MatrixClientPeg";
2424
import WidgetStore from "../src/stores/WidgetStore";
2525
import WidgetUtils from "../src/utils/WidgetUtils";
2626
import { VIDEO_CHANNEL_MEMBER } from "../src/utils/VideoChannelUtils";
2727
import createRoom, { canEncryptToAllUsers } from '../src/createRoom';
2828

2929
describe("createRoom", () => {
30+
mockPlatformPeg();
31+
3032
let client: MatrixClient;
3133
beforeEach(() => {
3234
stubClient();
3335
client = MatrixClientPeg.get();
3436
});
3537

38+
afterEach(() => jest.clearAllMocks());
39+
3640
it("sets up video rooms correctly", async () => {
3741
setupAsyncStoreWithClient(WidgetStore.instance, client);
3842
jest.spyOn(WidgetUtils, "waitForRoomWidget").mockResolvedValue();

0 commit comments

Comments
 (0)