mirror of
https://github.com/pavlobu/deskreen.git
synced 2025-05-29 05:40:08 -07:00
refactor choossAppOrScreenOverlay
This commit is contained in:
parent
73bce6ab81
commit
c16a22e06d
@ -58,23 +58,13 @@ export default function ChooseAppOrScreenOverlay(
|
||||
} = props;
|
||||
const classes = useStyles();
|
||||
|
||||
const [screenViewSharingIds, setScreenViewSharingIds] = useState<string[]>(
|
||||
[]
|
||||
);
|
||||
|
||||
const [appWindowsViewSharingIds, setAppWindowsViewSharingIds] = useState<
|
||||
string[]
|
||||
>([]);
|
||||
const [viewSharingIds, setViewSharingIds] = useState<string[]>([]);
|
||||
|
||||
const handleRefreshSources = useCallback(async () => {
|
||||
const ids = await ipcRenderer.invoke(IpcEvents.GetDesktopSharingSourceIds, {
|
||||
isEntireScreenToShareChosen,
|
||||
});
|
||||
if (isEntireScreenToShareChosen) {
|
||||
setScreenViewSharingIds(ids);
|
||||
} else {
|
||||
setAppWindowsViewSharingIds(ids);
|
||||
}
|
||||
setViewSharingIds(ids);
|
||||
}, [isEntireScreenToShareChosen]);
|
||||
|
||||
useEffect(() => {
|
||||
@ -189,11 +179,7 @@ export default function ChooseAppOrScreenOverlay(
|
||||
<Row>
|
||||
<div className={classes.sharePreviewsContainer}>
|
||||
<PreviewGridList
|
||||
viewSharingIds={
|
||||
isEntireScreenToShareChosen
|
||||
? screenViewSharingIds
|
||||
: appWindowsViewSharingIds
|
||||
}
|
||||
viewSharingIds={viewSharingIds}
|
||||
isEntireScreen={isEntireScreenToShareChosen}
|
||||
handleNextEntireScreen={() => {
|
||||
handleNextEntireScreen();
|
||||
|
Loading…
x
Reference in New Issue
Block a user