2
0
mirror of https://github.com/frappe/books.git synced 2024-09-18 18:49:01 +00:00

fix: Format code

This commit is contained in:
pu-raihan 2024-03-28 15:10:49 +05:30
parent ae5697dbad
commit bf48f075ba
2 changed files with 17 additions and 8 deletions

View File

@ -20,23 +20,25 @@ export default function registerIpcMainMessageListeners(main: Main) {
ipcMain.on(IPC_MESSAGES.RELOAD_MAIN_WINDOW, () => {
main.mainWindow!.reload();
});
ipcMain.on(IPC_MESSAGES.MINIMIZE_MAIN_WINDOW, () => {
main.mainWindow!.minimize();
});
ipcMain.on(IPC_MESSAGES.MAXIMIZE_MAIN_WINDOW, () => {
main.mainWindow!.isMaximized()?main.mainWindow!.unmaximize():main.mainWindow!.maximize()
main.mainWindow!.isMaximized()
? main.mainWindow!.unmaximize()
: main.mainWindow!.maximize();
});
ipcMain.on(IPC_MESSAGES.ISMAXIMIZED_MAIN_WINDOW, (event) => {
const isMaximized = main.mainWindow?.isMaximized() ?? false;
event.sender.send(IPC_MESSAGES.ISMAXIMIZED_RESULT, isMaximized);
event.sender.send(IPC_MESSAGES.ISMAXIMIZED_RESULT, isMaximized);
});
ipcMain.on(IPC_MESSAGES.ISFULLSCREEN_MAIN_WINDOW, (event) => {
const isFullscreen = main.mainWindow?.isFullScreen() ?? false;
event.sender.send(IPC_MESSAGES.ISFULLSCREEN_RESULT, isFullscreen);
event.sender.send(IPC_MESSAGES.ISFULLSCREEN_RESULT, isFullscreen);
});
ipcMain.on(IPC_MESSAGES.CLOSE_MAIN_WINDOW, () => {

View File

@ -1,6 +1,7 @@
<template>
<div
class="
relative
window-drag
flex
items-center
@ -17,7 +18,10 @@
<p v-if="companyName && dbPath" class="mx-auto text-sm">
{{ companyName }} - {{ dbPath }}
</p>
<div v-if="!isFullscreen" class="window-no-drag flex h-full items-center justify-end">
<div
v-if="!isFullscreen"
class="absolute window-no-drag flex h-full items-center right-0"
>
<div
class="
flex
@ -86,7 +90,10 @@ export default {
},
destroyed() {
window.removeEventListener('resize', this.getIsFullscreen);
document.removeEventListener('webkitfullscreenchange', this.getIsFullscreen);
document.removeEventListener(
'webkitfullscreenchange',
this.getIsFullscreen
);
document.removeEventListener('mozfullscreenchange', this.getIsFullscreen);
document.removeEventListener('fullscreenchange', this.getIsFullscreen);
document.removeEventListener('MSFullscreenChange', this.getIsFullscreen);
@ -106,7 +113,7 @@ export default {
ipc
.isMaximized()
.then((result) => {
this.isMax = result;
this.isMax = result;
})
.catch((error) => {
console.error(error);
@ -116,7 +123,7 @@ export default {
ipc
.isFullscreen()
.then((result) => {
this.isFullscreen = result;
this.isFullscreen = result;
})
.catch((error) => {
console.error(error);