mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
fix: fix windows build client error and release cannot open (#1959)
This commit is contained in:
@@ -7,6 +7,7 @@ import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
|||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { parse } from 'url';
|
import { parse } from 'url';
|
||||||
|
|
||||||
|
import { isMacOS } from '../../../utils';
|
||||||
import { getExchangeTokenParams, oauthEndpoint } from './google-auth';
|
import { getExchangeTokenParams, oauthEndpoint } from './google-auth';
|
||||||
|
|
||||||
const AFFINE_ROOT = path.join(os.homedir(), '.affine');
|
const AFFINE_ROOT = path.join(os.homedir(), '.affine');
|
||||||
@@ -32,12 +33,15 @@ export const registerHandlers = () => {
|
|||||||
|
|
||||||
ipcMain.handle('ui:sidebar-visibility-change', async (_, visible) => {
|
ipcMain.handle('ui:sidebar-visibility-change', async (_, visible) => {
|
||||||
// todo
|
// todo
|
||||||
const windows = BrowserWindow.getAllWindows();
|
// detect if os is macos
|
||||||
windows.forEach(w => {
|
if (isMacOS()) {
|
||||||
// hide window buttons when sidebar is not visible
|
const windows = BrowserWindow.getAllWindows();
|
||||||
w.setWindowButtonVisibility(visible);
|
windows.forEach(w => {
|
||||||
});
|
// hide window buttons when sidebar is not visible
|
||||||
logger.info('sidebar visibility change', visible);
|
w.setWindowButtonVisibility(visible);
|
||||||
|
});
|
||||||
|
logger.info('sidebar visibility change', visible);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('ui:get-google-oauth-code', async () => {
|
ipcMain.handle('ui:get-google-oauth-code', async () => {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ async function createWindow() {
|
|||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
width: mainWindowState.width,
|
width: mainWindowState.width,
|
||||||
minWidth: 640,
|
minWidth: 640,
|
||||||
transparent: true,
|
transparent: isMacOS(),
|
||||||
visualEffectState: 'active',
|
visualEffectState: 'active',
|
||||||
vibrancy: 'under-window',
|
vibrancy: 'under-window',
|
||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
|
|||||||
Reference in New Issue
Block a user