electron: save file to custom location

This commit is contained in:
Jan Prochazka
2021-01-28 18:52:59 +01:00
parent df976a84d2
commit fe1c5f5801
14 changed files with 132 additions and 13 deletions

View File

@@ -23,11 +23,16 @@ export default function useOpenNewTab() {
async (newTab, initialData = undefined, options) => {
let existing = null;
const { savedFile } = newTab.props || {};
if (savedFile) {
const { savedFile, savedFolder, savedFilePath } = newTab.props || {};
if (savedFile || savedFilePath) {
existing = openedTabs.find(
x =>
x.props && x.tabComponent == newTab.tabComponent && x.closedTime == null && x.props.savedFile == savedFile
x.props &&
x.tabComponent == newTab.tabComponent &&
x.closedTime == null &&
x.props.savedFile == savedFile &&
x.props.savedFolder == savedFolder &&
x.props.savedFilePath == savedFilePath
);
}