Skip to content

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

fix: winattr integration

Ilian Sapundshievc25dbf7fa3e7
diff --git a/app/services/platform-facade.ts b/app/services/platform-facade.ts
index ea2bfb624..2c2a8d5e3 100644
--- a/app/services/platform-facade.ts
+++ b/app/services/platform-facade.ts
@@ -213,15 +213,16 @@ export default class PlatformFacade {
dirPath.endsWith('\\' + AppConfig.metaFolder)
) {
// hide .ts folder on Windows
- const winattr = import('winattr');
- // @ts-ignore
- winattr.set(dirPath, { hidden: true }, err => {
- if (err) {
- console.warn('Error setting hidden attr. to dir: ' + dirPath);
- } else {
- console.log('Success setting hidden attr. to dir: ' + dirPath);
- }
+ import('winattr').then(winattr => {
+ winattr.set(dirPath, { hidden: true }, err => {
+ if (err) {
+ console.warn('Error setting hidden attr. to dir: ' + dirPath);
+ } else {
+ console.log('Success setting hidden attr. to dir: ' + dirPath);
+ }
+ });
});
+ // @ts-ignore
// return new Promise(resolve => {
// winattr.set(dirPath, { hidden: true }, err => {
// resolve(dirPath);