save from electron menu

This commit is contained in:
Jan Prochazka
2021-01-30 20:01:54 +01:00
parent 54d476a972
commit a17b76c570
4 changed files with 68 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import useTheme from './theme/useTheme';
import usePropsCompare from './utility/usePropsCompare';
import { useShowMenu } from './modals/showMenu';
import { setSelectedTabFunc } from './utility/common';
import getElectron from './utility/getElectron';
// const files = [
// { name: 'app.js' },
@@ -219,6 +220,16 @@ export default function TabsPanel() {
);
};
React.useEffect(() => {
const electron = getElectron();
if (electron) {
const { ipcRenderer } = electron;
const activeTab = tabs.find(x => x.selected);
window['activeTabId'] = activeTab ? activeTab.tabid : null;
ipcRenderer.send('update-menu');
}
}, [tabs]);
// console.log(
// 't',
// tabs.map(x => x.tooltip)