1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Fixed tests

This commit is contained in:
Laurent Cozic
2021-02-09 20:58:17 +00:00
parent b7f37fdf89
commit 9bfc7d9860

View File

@@ -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_);