2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 09:24:04 +00:00
books/fyo/demux/auth.ts
18alantom d0571a2450 chore: fix all fixable eslint errors in remaining non vue files
- update files to ignore
- delete babel.config.js
2023-06-22 14:22:54 +05:30

21 lines
571 B
TypeScript

import { AuthDemuxBase } from 'utils/auth/types';
import { IPC_ACTIONS } from 'utils/messages';
import { Creds } from 'utils/types';
const { ipcRenderer } = require('electron');
export class AuthDemux extends AuthDemuxBase {
#isElectron = false;
constructor(isElectron: boolean) {
super();
this.#isElectron = isElectron;
}
async getCreds(): Promise<Creds> {
if (this.#isElectron) {
return (await ipcRenderer.invoke(IPC_ACTIONS.GET_CREDS)) as Creds;
} else {
return { errorLogUrl: '', tokenString: '', telemetryUrl: '' };
}
}
}