blob: bedb573093fd3e0e8558d4f80014ac6f489544db (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import { type AuthInfo, type BrowserWindow, ipcRenderer } from 'electron';
import { state as ModalState } from './store';
const debug = require('../../preload-safe-debug')('Ferdium:feature:basicAuth');
const state = ModalState;
export default function initialize() {
debug('Initialize basicAuth feature');
window['ferdium'].features.basicAuth = {
state,
};
ipcRenderer.on('feature:basic-auth-request', (e, data) => {
debug(e, data);
// state.serviceId = data.serviceId;
state.authInfo = data.authInfo;
state.isModalVisible = true;
});
}
export function mainIpcHandler(mainWindow: BrowserWindow, authInfo: AuthInfo) {
debug('Sending basic auth call', authInfo);
mainWindow.webContents.send('feature:basic-auth-request', {
authInfo,
});
}
export { default as Component } from './Component';
|