Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit dc0713d

Browse files
TetrabyteTetrabyte
authored andcommitted
Bug fixes
2 parents 134868e + 669c879 commit dc0713d

File tree

5 files changed

+63
-39
lines changed

5 files changed

+63
-39
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/App.vue

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
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() {

src/renderer/components/FileView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default {
206206
margin: 20px;
207207
display: flex;
208208
flex-direction: column;
209-
max-width: 360px;
209+
max-width: 336px;
210210
/* overflow: hidden; */
211211
}
212212
</style>

src/renderer/components/LandingPage.vue

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,19 @@
4848
<!-- <button @click="$store.dispatch('toggleDark')">Toggle theme</button> -->
4949
<button v-if="!processing" class="coolbtn margin-vertical" @click="$parent.scanAll">Scan Cache</button>
5050
<button v-else class="coolbtn margin-vertical" @click="processing = false">Abort Tasks</button>
51+
<!-- <button
52+
v-if="!$parent.watcherRunning"
53+
class="coolbtn margin-vertical"
54+
@click="initWatch "
55+
>Watch For Updates</button>
56+
<button v-else class="coolbtn margin-vertical" @click="killWatch">Kill Watcher</button>-->
5157
<br>
5258

5359
<div v-if="foundFiletypes.length > 0" style="opacity:0.3;">Filetypes Discovered</div>
54-
<div class="flex">
60+
<div style="width:230px;" class="flex">
5561
<div
5662
class="coolbtn margin-right"
57-
style=" max-width: 260px;"
63+
style="padding: 10px; max-width: 260px;margin-bottom:7px;"
5864
v-for="(i, index) of foundFiletypes"
5965
:key="index"
6066
:class="{'filtered': currentFilter === i}"
@@ -170,7 +176,17 @@ export default {
170176
}, 30000);
171177
},
172178
methods: {
179+
initWatch() {
180+
this.$parent.watchBlocker = false;
181+
this.$parent.initWatchers();
182+
},
183+
killWatch() {
184+
this.$parent.watchBlocker = true;
185+
this.$parent.watcherRunning = false;
186+
},
173187
reload() {
188+
this.fileIndex = {};
189+
localStorage.clear();
174190
remote.app.reloadApp();
175191
},
176192
click(item) {

src/renderer/components/WindowsButtons.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
<template>
4-
<div class="buttons">
4+
<div :class="{'dark-buttons': $store.getters.getThemeName === 'light'}" class="buttons">
55
<div @click="minimize" class="button minimize">
66
<svg name="TitleBarMinimize" width="12" height="12" viewBox="0 0 12 12">
77
<rect fill="#ffffff" width="10" height="1" x="1" y="6"></rect>
@@ -55,19 +55,32 @@ export default {
5555
display: flex;
5656
flex-direction: row;
5757
/* width: 73px; */
58+
-webkit-app-region: no-drag;
5859
min-width: 73px;
5960
justify-content: center;
6061
position: absolute;
6162
right: 0;
6263
cursor: pointer;
6364
z-index: 100px;
6465
}
66+
.dark-buttons .button {
67+
&:hover {
68+
background: rgb(192, 192, 192);
69+
}
70+
&.close:hover {
71+
background: #e41414dc;
72+
}
73+
74+
svg {
75+
filter: invert(100%);
76+
}
77+
}
6578
.button {
66-
padding: 6px 10px;
79+
padding: 4px 12px;
6780
cursor: pointer;
6881
/* width: 33%; */
6982
&:hover {
70-
background: #00000027;
83+
background: var(--boxLight);
7184
}
7285
&.close:hover {
7386
background: #e41414dc;

0 commit comments

Comments
 (0)