mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	Merge pull request #1101 from TriliumNext/bugfix/mac-paste
Remove `mac_init` as it was breaking MacOS
This commit is contained in:
		
						commit
						c32778eb65
					
				@ -4,7 +4,6 @@ import noteTooltipService from "./services/note_tooltip.js";
 | 
			
		||||
import bundleService from "./services/bundle.js";
 | 
			
		||||
import toastService from "./services/toast.js";
 | 
			
		||||
import noteAutocompleteService from "./services/note_autocomplete.js";
 | 
			
		||||
import macInit from "./services/mac_init.js";
 | 
			
		||||
import electronContextMenu from "./menus/electron_context_menu.js";
 | 
			
		||||
import glob from "./services/glob.js";
 | 
			
		||||
import { t } from "./services/i18n.js";
 | 
			
		||||
@ -35,8 +34,6 @@ if (utils.isElectron()) {
 | 
			
		||||
    initOnElectron();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
macInit.init();
 | 
			
		||||
 | 
			
		||||
noteTooltipService.setupGlobalTooltip();
 | 
			
		||||
 | 
			
		||||
noteAutocompleteService.init();
 | 
			
		||||
 | 
			
		||||
@ -1,26 +0,0 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Mac specific initialization
 | 
			
		||||
 */
 | 
			
		||||
import utils from "./utils.js";
 | 
			
		||||
import shortcutService from "./shortcuts.js";
 | 
			
		||||
 | 
			
		||||
function init() {
 | 
			
		||||
    if (utils.isElectron() && utils.isMac()) {
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+c", () => exec("copy"));
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+v", () => exec("paste"));
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+x", () => exec("cut"));
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+a", () => exec("selectAll"));
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+z", () => exec("undo"));
 | 
			
		||||
        shortcutService.bindGlobalShortcut("meta+y", () => exec("redo"));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function exec(cmd: string) {
 | 
			
		||||
    document.execCommand(cmd);
 | 
			
		||||
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    init
 | 
			
		||||
};
 | 
			
		||||
@ -1,9 +1,6 @@
 | 
			
		||||
import utils from "./services/utils.js";
 | 
			
		||||
import macInit from "./services/mac_init.js";
 | 
			
		||||
import ko from "knockout";
 | 
			
		||||
 | 
			
		||||
macInit.init();
 | 
			
		||||
 | 
			
		||||
// TriliumNextTODO: properly make use of below types
 | 
			
		||||
// type SetupModelSetupType = "new-document" | "sync-from-desktop" | "sync-from-server" | "";
 | 
			
		||||
// type SetupModelStep = "sync-in-progress" | "setup-type" | "new-document-in-progress" | "sync-from-desktop";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user