fix #33
This commit is contained in:
parent
0df7bf35ba
commit
e1cd3117b6
2 changed files with 1 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ const SCREEN_WIDTH = Number(process.env.SCREEN_WIDTH) || 1280;
|
||||||
const SCREEN_HEIGHT = Number(process.env.SCREEN_HEIGHT) || 1280;
|
const SCREEN_HEIGHT = Number(process.env.SCREEN_HEIGHT) || 1280;
|
||||||
|
|
||||||
const db = await jsonDb('epic-games.json');
|
const db = await jsonDb('epic-games.json');
|
||||||
|
db.data ||= {};
|
||||||
const migrateDb = (user) => {
|
const migrateDb = (user) => {
|
||||||
if (user in db.data || !('claimed' in db.data)) return;
|
if (user in db.data || !('claimed' in db.data)) return;
|
||||||
db.data[user] = {};
|
db.data[user] = {};
|
||||||
|
|
|
||||||
1
util.js
1
util.js
|
|
@ -16,7 +16,6 @@ import { Low, JSONFile } from 'lowdb';
|
||||||
export const jsonDb = async file => {
|
export const jsonDb = async file => {
|
||||||
const db = new Low(new JSONFile(dataDir(file)));
|
const db = new Low(new JSONFile(dataDir(file)));
|
||||||
await db.read();
|
await db.read();
|
||||||
db.data ||= {};
|
|
||||||
return db;
|
return db;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue