mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	reset window position
This commit is contained in:
		@@ -49,6 +49,10 @@ function createMainWindow() {
 | 
			
		||||
		defaultWidth: 1000,
 | 
			
		||||
		defaultHeight: 600
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	// Let's keep the window position global so that we can access it in other process
 | 
			
		||||
	global.mainWindowState = mainWindowState;
 | 
			
		||||
 | 
			
		||||
	const win = new electron.BrowserWindow({
 | 
			
		||||
		// This settings needs to be saved in config
 | 
			
		||||
		title: 'Zulip',
 | 
			
		||||
@@ -188,6 +192,12 @@ app.on('ready', () => {
 | 
			
		||||
		page.send('destroytray');
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	ipcMain.on('clear-app-settings', () => {
 | 
			
		||||
		global.mainWindowState.unmanage(mainWindow);
 | 
			
		||||
		app.relaunch();
 | 
			
		||||
		app.exit();
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	ipcMain.on('toggle-app', () => {
 | 
			
		||||
		if (mainWindow.isVisible()) {
 | 
			
		||||
			mainWindow.hide();
 | 
			
		||||
 
 | 
			
		||||
@@ -371,7 +371,7 @@ class AppMenu {
 | 
			
		||||
		const getAppPath = path.join(app.getPath('appData'), appName, 'window-state.json');
 | 
			
		||||
 | 
			
		||||
		fs.unlink(getAppPath, () => {
 | 
			
		||||
			setTimeout(() => app.relaunch(), app.exit(), 1000);
 | 
			
		||||
			setTimeout(() => AppMenu.sendAction('clear-app-data'), 1000);
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
require(__dirname + '/js/tray.js');
 | 
			
		||||
const {ipcRenderer, remote} = require('electron');
 | 
			
		||||
const { ipcRenderer, remote } = require('electron');
 | 
			
		||||
 | 
			
		||||
const {session} = remote;
 | 
			
		||||
const { session } = remote;
 | 
			
		||||
 | 
			
		||||
const DomainUtil = require(__dirname + '/js/utils/domain-util.js');
 | 
			
		||||
const WebView = require(__dirname + '/js/components/webview.js');
 | 
			
		||||
@@ -301,6 +301,10 @@ class ServerManagerView {
 | 
			
		||||
			ipcRenderer.send('reload-full-app');
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('clear-app-data', () => {
 | 
			
		||||
			ipcRenderer.send('clear-app-settings');
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('switch-server-tab', (event, index) => {
 | 
			
		||||
			this.activateTab(index);
 | 
			
		||||
		});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user