mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	create "disableTray" option
This commit is contained in:
		
							parent
							
								
									6cec8bcda8
								
							
						
					
					
						commit
						6f238f5f1a
					
				@ -27,7 +27,7 @@ app.on('ready', async () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // if db is not initialized -> setup process
 | 
					    // if db is not initialized -> setup process
 | 
				
			||||||
    // if db is initialized, then we need to wait until the migration process is finished
 | 
					    // if db is initialized, then we need to wait until the migration process is finished
 | 
				
			||||||
    if (await sqlInit.isDbInitialized()) {
 | 
					    if (sqlInit.isDbInitialized()) {
 | 
				
			||||||
        await sqlInit.dbReady;
 | 
					        await sqlInit.dbReady;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        await windowService.createMainWindow(app);
 | 
					        await windowService.createMainWindow(app);
 | 
				
			||||||
@ -57,3 +57,4 @@ app.on('will-quit', () => {
 | 
				
			|||||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
 | 
					process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require('./src/www');
 | 
					require('./src/www');
 | 
				
			||||||
 | 
					const options = require("./src/public/app/services/options.js");
 | 
				
			||||||
 | 
				
			|||||||
@ -88,6 +88,7 @@ const defaultOptions = [
 | 
				
			|||||||
    { name: 'downloadImagesAutomatically', value: 'true', isSynced: true },
 | 
					    { name: 'downloadImagesAutomatically', value: 'true', isSynced: true },
 | 
				
			||||||
    { name: 'minTocHeadings', value: '5', isSynced: true },
 | 
					    { name: 'minTocHeadings', value: '5', isSynced: true },
 | 
				
			||||||
    { name: 'checkForUpdates', value: 'true', isSynced: true },
 | 
					    { name: 'checkForUpdates', value: 'true', isSynced: true },
 | 
				
			||||||
 | 
					    { name: 'disableTray', value: 'false', isSynced: false },
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function initStartupOptions() {
 | 
					function initStartupOptions() {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,8 @@
 | 
				
			|||||||
const { Menu, Tray } = require('electron');
 | 
					const { Menu, Tray } = require('electron');
 | 
				
			||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
const windowService = require("./window");
 | 
					const windowService = require("./window");
 | 
				
			||||||
 | 
					const optionService = require("./options");
 | 
				
			||||||
 | 
					const options = require("../public/app/services/options.js");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const UPDATE_TRAY_EVENTS = [
 | 
					const UPDATE_TRAY_EVENTS = [
 | 
				
			||||||
    'minimize', 'maximize', 'show', 'hide'
 | 
					    'minimize', 'maximize', 'show', 'hide'
 | 
				
			||||||
@ -92,6 +94,10 @@ const changeVisibility = () => {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function createTray() {
 | 
					function createTray() {
 | 
				
			||||||
 | 
					    if (optionService.getOptionBool("disableTray")) {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tray = new Tray(getIconPath());
 | 
					    tray = new Tray(getIconPath());
 | 
				
			||||||
    tray.setToolTip('Trilium Notes')
 | 
					    tray.setToolTip('Trilium Notes')
 | 
				
			||||||
    // Restore focus
 | 
					    // Restore focus
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user