From ed8514c8c7039f970db2827a2ed32e61aeb1972c Mon Sep 17 00:00:00 2001 From: kPherox Date: Sat, 27 Apr 2019 18:49:31 +0900 Subject: [PATCH] Add interface for account docs of NeDB --- src/main/Auth.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/Auth.ts b/src/main/Auth.ts index c67d5717..7bcd0fb1 100644 --- a/src/main/Auth.ts +++ b/src/main/Auth.ts @@ -2,7 +2,16 @@ import { ipcMain, Event, shell, app } from "electron" import Mastodon, { Response, Account } from "megalodon" import { join } from "path" import Datastore from "nedb" -import Window from "./Window" + +interface AccountDoc { + _id?: string + domain: string + acct: string + avatar: string + avatarStatic: string + accessToken: string + color?: string +} export default class Auth { public static ready() { @@ -67,13 +76,12 @@ export default class Auth { filename: join(app.getPath("userData"), "account.db"), autoload: true }) - let docs = { + let docs: AccountDoc = { domain: instance, acct: you.acct, avatar: you.avatar, avatarStatic: you.avatar_static, accessToken: tokenData.accessToken, - color: undefined } db.insert(docs, function (err, newDocs) { if (err) {