1
0
mirror of https://github.com/pavlobu/deskreen.git synced 2025-05-28 05:10:09 -07:00

remove .remote from preview grid list

This commit is contained in:
Pavlo Buidenkov 2022-05-30 21:37:48 +02:00
parent 42cb2a28e2
commit 5188c499cf
3 changed files with 10 additions and 15 deletions

View File

@ -1,12 +1,8 @@
import React from 'react';
import { remote } from 'electron';
import { ipcRenderer } from 'electron';
import { Row, Col } from 'react-flexbox-grid';
import SharingSessionService from '../../../features/SharingSessionService';
import SharingSourcePreviewCard from '../../SharingSourcePreviewCard';
const sharingSessionService = remote.getGlobal(
'sharingSessionService'
) as SharingSessionService;
import { IpcEvents } from '../../../main/IpcEvents.enum';
class PreviewGridListProps {
viewSharingIds: string[] = [];
@ -41,15 +37,7 @@ export default function PreviewGridList(props: PreviewGridListProps) {
sharingSourceID={id}
isChangeApperanceOnHover
onClickCard={async () => {
let sharingSession;
if (
sharingSessionService.waitingForConnectionSharingSession !==
null
) {
sharingSession =
sharingSessionService.waitingForConnectionSharingSession;
sharingSession.setDesktopCapturerSourceID(id);
}
ipcRenderer.invoke(IpcEvents.SetDesktopCapturerSourceId, id);
if (isEntireScreen) {
handleNextEntireScreen();
} else {

View File

@ -19,4 +19,5 @@ export enum IpcEvents {
GetPendingConnectionDevice = 'get-pending-connection-device',
GetWaitingForConnectionSharingSessionRoomId = 'get-waiting-for-connection-sharing-session-room-id',
GetDesktopSharingSourceIds = 'get-desktop-sharing-source-ids',
SetDesktopCapturerSourceId = 'set-desktop-capturer-source-id',
}

View File

@ -260,4 +260,10 @@ export default function initIpcMainHandlers(
.map((source) => source.id);
}
);
ipcMain.handle(IpcEvents.SetDesktopCapturerSourceId, (_, id) => {
getDeskreenGlobal().sharingSessionService.waitingForConnectionSharingSession?.setDesktopCapturerSourceID(
id
);
});
}