Files
aura-keep/router-app/static/enter/electron.js
2025-03-10 10:50:06 +08:00

23 lines
620 B
JavaScript

export const checkIsElectron = () => {
return typeof window !== 'undefined' && typeof window.electron === 'object';
};
export const getElectron = () => {
return window.electron;
};
export const saveAppConfig = async (config) => {
const check = checkIsElectron();
if (!check) {
console.log('not electron');
return [];
}
const electron = getElectron();
const saveResult = await electron.ipcRenderer.invoke('save-app-config', config);
return saveResult;
};
export const relunch = async () => {
const check = checkIsElectron();
if (!check) {
console.log('not electron');
return [];
}
};