mirror of
https://github.com/pavlobu/deskreen.git
synced 2025-05-31 14:50:09 -07:00
remove .remote from preview grid list
This commit is contained in:
parent
42cb2a28e2
commit
5188c499cf
@ -1,12 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { remote } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { Row, Col } from 'react-flexbox-grid';
|
import { Row, Col } from 'react-flexbox-grid';
|
||||||
import SharingSessionService from '../../../features/SharingSessionService';
|
|
||||||
import SharingSourcePreviewCard from '../../SharingSourcePreviewCard';
|
import SharingSourcePreviewCard from '../../SharingSourcePreviewCard';
|
||||||
|
import { IpcEvents } from '../../../main/IpcEvents.enum';
|
||||||
const sharingSessionService = remote.getGlobal(
|
|
||||||
'sharingSessionService'
|
|
||||||
) as SharingSessionService;
|
|
||||||
|
|
||||||
class PreviewGridListProps {
|
class PreviewGridListProps {
|
||||||
viewSharingIds: string[] = [];
|
viewSharingIds: string[] = [];
|
||||||
@ -41,15 +37,7 @@ export default function PreviewGridList(props: PreviewGridListProps) {
|
|||||||
sharingSourceID={id}
|
sharingSourceID={id}
|
||||||
isChangeApperanceOnHover
|
isChangeApperanceOnHover
|
||||||
onClickCard={async () => {
|
onClickCard={async () => {
|
||||||
let sharingSession;
|
ipcRenderer.invoke(IpcEvents.SetDesktopCapturerSourceId, id);
|
||||||
if (
|
|
||||||
sharingSessionService.waitingForConnectionSharingSession !==
|
|
||||||
null
|
|
||||||
) {
|
|
||||||
sharingSession =
|
|
||||||
sharingSessionService.waitingForConnectionSharingSession;
|
|
||||||
sharingSession.setDesktopCapturerSourceID(id);
|
|
||||||
}
|
|
||||||
if (isEntireScreen) {
|
if (isEntireScreen) {
|
||||||
handleNextEntireScreen();
|
handleNextEntireScreen();
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,4 +19,5 @@ export enum IpcEvents {
|
|||||||
GetPendingConnectionDevice = 'get-pending-connection-device',
|
GetPendingConnectionDevice = 'get-pending-connection-device',
|
||||||
GetWaitingForConnectionSharingSessionRoomId = 'get-waiting-for-connection-sharing-session-room-id',
|
GetWaitingForConnectionSharingSessionRoomId = 'get-waiting-for-connection-sharing-session-room-id',
|
||||||
GetDesktopSharingSourceIds = 'get-desktop-sharing-source-ids',
|
GetDesktopSharingSourceIds = 'get-desktop-sharing-source-ids',
|
||||||
|
SetDesktopCapturerSourceId = 'set-desktop-capturer-source-id',
|
||||||
}
|
}
|
||||||
|
@ -260,4 +260,10 @@ export default function initIpcMainHandlers(
|
|||||||
.map((source) => source.id);
|
.map((source) => source.id);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ipcMain.handle(IpcEvents.SetDesktopCapturerSourceId, (_, id) => {
|
||||||
|
getDeskreenGlobal().sharingSessionService.waitingForConnectionSharingSession?.setDesktopCapturerSourceID(
|
||||||
|
id
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user