You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Fixed tests
This commit is contained in:
@@ -16,13 +16,13 @@ export default class FileHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async load(): Promise<SettingValues> {
|
public async load(): Promise<SettingValues> {
|
||||||
if (this.valueJsonCache_) return JSON.parse(this.valueJsonCache_);
|
if (!this.valueJsonCache_) {
|
||||||
|
|
||||||
if (!(await shim.fsDriver().exists(this.filePath_))) {
|
if (!(await shim.fsDriver().exists(this.filePath_))) {
|
||||||
this.valueJsonCache_ = '{}';
|
this.valueJsonCache_ = '{}';
|
||||||
} else {
|
} else {
|
||||||
this.valueJsonCache_ = await shim.fsDriver().readFile(this.filePath_, 'utf8');
|
this.valueJsonCache_ = await shim.fsDriver().readFile(this.filePath_, 'utf8');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const values = JSON.parse(this.valueJsonCache_);
|
const values = JSON.parse(this.valueJsonCache_);
|
||||||
|
|||||||
Reference in New Issue
Block a user