Skip to content

Commit e1972d5

Browse files
committed
fix file not found error
1 parent f665fb8 commit e1972d5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/app/components/home/home.component.scss

+3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ $haiti : #170139;
7373
overflow: hidden;
7474
font-family: $font-sans-serif;
7575
color: $pelorous;
76+
color: white;
7677
background: transparent;
78+
background: linear-gradient(270deg, darken( #F97C24, 10% ), darken( #D9497D, 10%));
79+
7780
.message {
7881
font-weight: 400;
7982
display: inline-block;

src/app/components/home/home.component.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
2424
}
2525

2626
// COMMONLY USED ELECTRON SERVICE REFERENCES
27-
filePath = this.electronService.remote.app.getPath('appData') + '/list.json';
27+
filePath = this.electronService.remote.app.getPath('appData') + '/list2.json';
2828
fs = this.electronService.fs;
2929
app = this.electronService.remote.app;
3030
window = this.electronService.remote.getCurrentWindow();
@@ -220,6 +220,10 @@ export class HomeComponent implements OnInit, AfterViewInit {
220220
getCurrentList() {
221221
try {
222222
this.data = JSON.parse(this.fs.readFileSync(this.filePath).toString());
223+
return this.data;
224+
} catch (error) {
225+
// if there was some kind of error, return the passed in defaults instead.
226+
console.log('there seems to be an issue getting the current data');
223227
if (!this.data) {
224228
this.data = {
225229
hideOnboarding: false,
@@ -228,10 +232,6 @@ export class HomeComponent implements OnInit, AfterViewInit {
228232
this.fs.writeFileSync(this.filePath, this.data, 'utf-8');
229233
}
230234
return this.data;
231-
} catch (error) {
232-
// if there was some kind of error, return the passed in defaults instead.
233-
console.log('there seems to be an issue getting the current data');
234-
return false;
235235
}
236236
}
237237

@@ -458,7 +458,8 @@ export class HomeComponent implements OnInit, AfterViewInit {
458458
}
459459

460460
ngOnInit() {
461-
this.getCurrentList();
461+
const data = this.getCurrentList();
462+
console.log( 'data is' + data );
462463
this.sanitizeData();
463464
this.updateData();
464465
}

0 commit comments

Comments
 (0)