Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fixing build issues for cordova and web

Ilian Sapundshiev92f7b8b6c022
diff --git a/app/reducers/app.js b/app/reducers/app.js
index b2d83cefe..6b291b988 100644
--- a/app/reducers/app.js
+++ b/app/reducers/app.js
@@ -18,7 +18,6 @@
*/
import uuidv1 from 'uuid';
-import winattr from 'winattr';
import { type Location, locationType } from './locations';
import PlatformIO from '../services/platform-io';
import AppConfig from '../config';
@@ -572,17 +571,6 @@ export const actions = {
settings,
dispatch
);
- // Make .ts a hidden folder under Windows
- // TODO move functionality to electron-io.js
- if (AppConfig.isElectron && AppConfig.isWin && !PlatformIO.haveObjectStoreSupport()) {
- winattr.set(metaDirectory, { hidden: true }, (err) => {
- if (err) {
- console.warn('Error setting hidden attr. to dir: ' + metaDirectory);
- } else {
- console.log('Success setting hidden attr. to dir: ' + metaDirectory);
- }
- });
- }
return true;
})
.catch(() => {
diff --git a/app/services/electron-io.js b/app/services/electron-io.js
index f0f3e5841..fa3bc0d71 100644
--- a/app/services/electron-io.js
+++ b/app/services/electron-io.js
@@ -18,9 +18,11 @@
*/
import fsextra from 'fs-extra';
+import winattr from 'winattr';
import { extractParentDirectoryPath, getMetaDirectoryPath } from '../utils/paths';
import { arrayBufferToBuffer } from '../utils/misc';
import AppConfig from '../config';
+import PlatformIO from './platform-io';
import TrayIcon from '../assets/icons/trayIcon.png';
// import TrayIconWin from '../assets/icons/trayIcon.ico';
import TrayIcon2x from '../assets/icons/[email protected]';
@@ -430,7 +432,19 @@ export default class ElectronIO {
reject('Error creating folder: ' + dirPath + ' with ' + error);
return;
}
- resolve(dirPath);
+ // Make newly created .ts folders hidden under Windows
+ if (AppConfig.isWin && !PlatformIO.haveObjectStoreSupport() && dirPath.endsWith('\\' + AppConfig.metaFolder)) {
+ winattr.set(dirPath, { hidden: true }, (err) => {
+ resolve(dirPath);
+ if (err) {
+ console.warn('Error setting hidden attr. to dir: ' + dirPath);
+ } else {
+ console.log('Success setting hidden attr. to dir: ' + dirPath);
+ }
+ });
+ } else {
+ resolve(dirPath);
+ }
});
});
};