Skip to content

Commit

Permalink
fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
vogler committed Nov 12, 2022
1 parent 0df7bf3 commit e1cd311
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions epic-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const SCREEN_WIDTH = Number(process.env.SCREEN_WIDTH) || 1280;
const SCREEN_HEIGHT = Number(process.env.SCREEN_HEIGHT) || 1280;

const db = await jsonDb('epic-games.json');
db.data ||= {};
const migrateDb = (user) => {
if (user in db.data || !('claimed' in db.data)) return;
db.data[user] = {};
Expand Down
1 change: 0 additions & 1 deletion util.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Low, JSONFile } from 'lowdb';
export const jsonDb = async file => {
const db = new Low(new JSONFile(dataDir(file)));
await db.read();
db.data ||= {};
return db;
};

Expand Down

0 comments on commit e1cd311

Please sign in to comment.