Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

Commit f53397a

Browse files
committed
fix: avoid the screen white-out.
Set to ignore the invalid stored json.
1 parent aaafee7 commit f53397a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/actions/dat-middleware.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,13 @@ export default class DatMiddleware {
382382
} catch (_) {
383383
return
384384
}
385-
const datOpts = JSON.parse(blob)
385+
const datOpts = JSON.parse(blob || '{}')
386386

387-
blob = {}
387+
blob = null
388388
try {
389389
blob = await readFile(joinPath(this.dataDir, 'paused.json'), 'utf8')
390390
} catch (_) {}
391-
const paused = JSON.parse(blob)
391+
const paused = JSON.parse(blob || '{}')
392392

393393
for (const key of Object.keys(datOpts)) {
394394
const opts = JSON.parse(datOpts[key])

0 commit comments

Comments
 (0)