Bread has been achieved.

- Window now creates and loads properly (Due to config not being created halted vue)
- Foundation for app.ts created for functions to run in certain stages of the app (start/init, ready, exit)
- Electron-Store created in class ConfigStore. Store instance stored in ConfigStore.store. Gets a bit compilicated and might change the class or variable name later on.
This commit is contained in:
Core 2022-01-07 23:53:59 +00:00
parent 7cdb0afaa4
commit a7b5b36590
No known key found for this signature in database
GPG key ID: 1B77805746C47C28
4 changed files with 196 additions and 35 deletions

View file

@ -10,9 +10,15 @@ import {Stream} from "stream";
export class Win {
win: any | undefined = null;
app: electron.App | undefined;
app: any | undefined = null;
store: any | undefined = null;
devMode: boolean = !electron.app.isPackaged;
constructor(app: electron.App, store: any) {
this.app = app;
this.store = store;
}
private paths: any = {
srcPath: path.join(__dirname, "../../src"),
resourcePath: path.join(__dirname, "../../resources"),
@ -124,7 +130,7 @@ export class Win {
private startWebServer(): void {
const app = express();
// TODO: app.use(express.static(path.join(this.paths.srcPath, './renderer/')));
app.use(express.static(path.join(this.paths.srcPath, './renderer/')));
app.set("views", path.join(this.paths.srcPath, './renderer/views'));
app.set("view engine", "ejs");
@ -277,24 +283,6 @@ export class Win {
return await yt.search(u)
})
electron.ipcMain.handle('getStoreValue', (event, key, defaultValue) => {
// return (defaultValue ? app.cfg.get(key, true) : app.cfg.get(key));
return null
});
electron.ipcMain.handle('setStoreValue', (event, key, value) => {
// app.cfg.set(key, value);
});
electron.ipcMain.on('getStore', (event) => {
// event.returnValue = app.cfg.store
event.returnValue = null
})
electron.ipcMain.on('setStore', (event, store) => {
// app.cfg.store = store
})
electron.ipcMain.handle('setVibrancy', (event, key, value) => {
this.win.setVibrancy(value)
});