mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Use source id directly
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
5ed4f3f54f
commit
2f1ee610d9
2 changed files with 8 additions and 4 deletions
7
src/@types/global.d.ts
vendored
7
src/@types/global.d.ts
vendored
|
@ -49,7 +49,6 @@ import PerformanceMonitor from "../performance";
|
||||||
import UIStore from "../stores/UIStore";
|
import UIStore from "../stores/UIStore";
|
||||||
import { SetupEncryptionStore } from "../stores/SetupEncryptionStore";
|
import { SetupEncryptionStore } from "../stores/SetupEncryptionStore";
|
||||||
import { RoomScrollStateStore } from "../stores/RoomScrollStateStore";
|
import { RoomScrollStateStore } from "../stores/RoomScrollStateStore";
|
||||||
import { DesktopCapturerSource } from "matrix-js-sdk/src/webrtc/call";
|
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
|
||||||
|
@ -97,6 +96,12 @@ declare global {
|
||||||
electron?: Electron;
|
electron?: Electron;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface DesktopCapturerSource {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
thumbnailURL: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface GetSourcesOptions {
|
interface GetSourcesOptions {
|
||||||
types: Array<string>;
|
types: Array<string>;
|
||||||
thumbnailSize?: {
|
thumbnailSize?: {
|
||||||
|
|
|
@ -22,7 +22,6 @@ import classNames from 'classnames';
|
||||||
import AccessibleButton from './AccessibleButton';
|
import AccessibleButton from './AccessibleButton';
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView';
|
import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView';
|
||||||
import { DesktopCapturerSource } from "matrix-js-sdk/src/webrtc/call";
|
|
||||||
|
|
||||||
export function getDesktopCapturerSources(): Promise<Array<DesktopCapturerSource>> {
|
export function getDesktopCapturerSources(): Promise<Array<DesktopCapturerSource>> {
|
||||||
const options: GetSourcesOptions = {
|
const options: GetSourcesOptions = {
|
||||||
|
@ -86,7 +85,7 @@ export interface PickerIState {
|
||||||
selectedSource: DesktopCapturerSource | null;
|
selectedSource: DesktopCapturerSource | null;
|
||||||
}
|
}
|
||||||
export interface PickerIProps {
|
export interface PickerIProps {
|
||||||
onFinished(source: DesktopCapturerSource): void;
|
onFinished(sourceId: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@replaceableComponent("views.elements.DesktopCapturerSourcePicker")
|
@replaceableComponent("views.elements.DesktopCapturerSourcePicker")
|
||||||
|
@ -131,7 +130,7 @@ export default class DesktopCapturerSourcePicker extends React.Component<
|
||||||
};
|
};
|
||||||
|
|
||||||
private onShare = (): void => {
|
private onShare = (): void => {
|
||||||
this.props.onFinished(this.state.selectedSource);
|
this.props.onFinished(this.state.selectedSource.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
private onTabChange = (): void => {
|
private onTabChange = (): void => {
|
||||||
|
|
Loading…
Reference in a new issue