33 <Alerts />
44 <Sidebar />
55 <div class =" topbar" >
6- <WindowsButtons v-if =" isWindows " />
7- <TrafficLights v-else />
6+ <TrafficLights v-if =" isMac() " />
7+ <WindowsButtons v-else />
88 </div >
99 <div id =" app" >
1010 <Panel />
@@ -64,7 +64,7 @@ export default {
6464 let uid = uuid .v4 ().replace (/ -/ g , " " );
6565 request .open (
6666 " GET" ,
67- ` https://jamiepine.com/cachemonkey ?uuid=${ uid} &version=${ remote .app .getVersion ()} `
67+ ` https://jamiepine.com/cachemonkeystats ?uuid=${ uid} &version=${ remote .app .getVersion ()} `
6868 );
6969 request .send ();
7070 } catch (error) {}
@@ -129,7 +129,7 @@ export default {
129129 this .fileIndex = JSON .parse (localStorage .getItem (" fileIndex" ));
130130 this .dumpScanComplete = true ;
131131 this .evaluateFileIndex ();
132- this .initWatchers ();
132+ // this.initWatchers();
133133 } else {
134134 this .scanDump ();
135135 }
@@ -154,7 +154,7 @@ export default {
154154 // this.scanAll();
155155 },
156156 dirScanComplete () {
157- this .initWatchers ();
157+ // this.initWatchers();
158158 },
159159 currentTask () {
160160 if (this .watcherRunning ) {
@@ -164,27 +164,22 @@ export default {
164164 },
165165 methods: {
166166 initWatchers () {
167- if (this .watcherRunning ) return ;
168- setTimeout (() => (this .watchBlocker = false ), 15000 );
169- if (process .env .NODE_ENV !== " development" )
170- for (let dir of this .watchDirectories ) {
171- const watcher = chokidar .watch (dir .dir , { persistent: true });
172- this .watcherRunning = true ;
173- watcher .on (" add" , async path => {
174- if (
175- ! this .watchBlocker &&
176- ! this .processing &&
177- this .dumpScanComplete
178- ) {
179- console .log (" File" , path, " has been added" );
180- let arr = path .split (" /" );
181- await this .processItem (dir .dir , path, arr[arr .length - 1 ]);
182- this .fileIndex = Object .assign ({}, this .fileIndex );
183- this .currentTask = " Waiting for changes..." ;
184- }
185- });
186- this .currentTask = " Waiting for changes..." ;
187- }
167+ // if (this.watcherRunning) return;
168+ // console.log("init watchers");
169+ // for (let dir of this.watchDirectories) {
170+ // const watcher = chokidar.watch(dir.dir, { persistent: true });
171+ // this.watcherRunning = true;
172+ // watcher.on("add", async path => {
173+ // if (!this.watchBlocker && !this.processing && this.dumpScanComplete) {
174+ // console.log("File", path, "has been added");
175+ // let arr = path.split("/");
176+ // await this.processItem(dir.dir, path, arr[arr.length - 1]);
177+ // this.fileIndex = Object.assign({}, this.fileIndex);
178+ // this.currentTask = "Waiting for changes...";
179+ // }
180+ // });
181+ // this.currentTask = "Waiting for changes...";
182+ // }
188183 },
189184 evaluateFileIndex () {
190185 for (let i of Object .keys (this .fileIndex )) {
@@ -247,7 +242,7 @@ export default {
247242 this .dumpScanComplete = true ;
248243 this .processing = false ;
249244 this .currentTask = ` Ready.` ;
250- this .initWatchers ();
245+ // this.initWatchers();
251246 resolve ();
252247 } catch (e) {
253248 this .processing = false ;
@@ -260,7 +255,7 @@ export default {
260255 for (let directory of this .watchDirectories ) {
261256 await this .scanDirectory (directory);
262257 }
263- this .initWatchers ();
258+ // this.initWatchers();
264259 this .dirScanComplete = true ;
265260 },
266261 scanDirectory (directory ) {
@@ -285,7 +280,7 @@ export default {
285280 this .processing = false ;
286281 this .totalAnalysed = 0 ;
287282 this .currentTask = " Scan complete" ;
288- this .initWatchers ();
283+ // this.initWatchers();
289284 this .fileIndex = Object .assign ({}, this .fileIndex );
290285 resolve ();
291286 });
@@ -400,12 +395,12 @@ export default {
400395
401396 // append to body
402397 document .body .appendChild (style);
398+ },
399+ isMac () {
400+ return os .platform () === " darwin" ;
403401 }
404402 },
405403 computed: {
406- isWindows () {
407- return !! os .platform () === " win32" ;
408- },
409404 ... mapGetters ([" getTheme" , " getThemeName" ]),
410405 processing: {
411406 get () {
0 commit comments