mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	refactor(hidden-subtree): deduplicate launchers
This commit is contained in:
		
							parent
							
								
									303cf65020
								
							
						
					
					
						commit
						96dc063b50
					
				| @ -1,23 +1,26 @@ | |||||||
| import { t } from "i18next"; | import { t } from "i18next"; | ||||||
| import type { HiddenSubtreeItem } from "./hidden_subtree.js"; | import type { HiddenSubtreeItem } from "./hidden_subtree.js"; | ||||||
| 
 | 
 | ||||||
| export const desktopAvailableLaunchers: HiddenSubtreeItem[] = [ | const sharedLaunchers: Record<string, Omit<HiddenSubtreeItem, "id">> = { | ||||||
|     { |     backInHistory: { | ||||||
|         id: "_lbBackInHistory", |  | ||||||
|         title: t("hidden-subtree.go-to-previous-note-title"), |         title: t("hidden-subtree.go-to-previous-note-title"), | ||||||
|         type: "launcher", |         type: "launcher", | ||||||
|         builtinWidget: "backInHistoryButton", |         builtinWidget: "backInHistoryButton", | ||||||
|         icon: "bx bxs-chevron-left", |         icon: "bx bxs-chevron-left", | ||||||
|         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] |         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] | ||||||
|     }, |     }, | ||||||
|     { |     forwardInHistory: { | ||||||
|         id: "_lbForwardInHistory", |  | ||||||
|         title: t("hidden-subtree.go-to-next-note-title"), |         title: t("hidden-subtree.go-to-next-note-title"), | ||||||
|         type: "launcher", |         type: "launcher", | ||||||
|         builtinWidget: "forwardInHistoryButton", |         builtinWidget: "forwardInHistoryButton", | ||||||
|         icon: "bx bxs-chevron-right", |         icon: "bx bxs-chevron-right", | ||||||
|         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] |         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] | ||||||
|     }, |     } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | export const desktopAvailableLaunchers: HiddenSubtreeItem[] = [ | ||||||
|  |     { id: "_lbBackInHistory", ...sharedLaunchers.backInHistory }, | ||||||
|  |     { id: "_lbForwardInHistory", ...sharedLaunchers.forwardInHistory }, | ||||||
|     { id: "_lbBackendLog", title: t("hidden-subtree.backend-log-title"), type: "launcher", targetNoteId: "_backendLog", icon: "bx bx-terminal" } |     { id: "_lbBackendLog", title: t("hidden-subtree.backend-log-title"), type: "launcher", targetNoteId: "_backendLog", icon: "bx bx-terminal" } | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| @ -64,21 +67,7 @@ export const mobileAvailableLaunchers: HiddenSubtreeItem[] = [ | |||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| export const mobileVisibleLaunchers: HiddenSubtreeItem[] = [ | export const mobileVisibleLaunchers: HiddenSubtreeItem[] = [ | ||||||
|     { |     { id: "_lbMobileBackInHistory", ...sharedLaunchers.backInHistory }, | ||||||
|         id: "_lbMobileBackInHistory", |     { id: "_lbMobileForwardInHistory", ...sharedLaunchers.forwardInHistory }, | ||||||
|         title: t("hidden-subtree.go-to-previous-note-title"), |  | ||||||
|         type: "launcher", |  | ||||||
|         builtinWidget: "backInHistoryButton", |  | ||||||
|         icon: "bx bxs-chevron-left", |  | ||||||
|         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] |  | ||||||
|     }, |  | ||||||
|     { |  | ||||||
|         id: "_lbMobileForwardInHistory", |  | ||||||
|         title: t("hidden-subtree.go-to-next-note-title"), |  | ||||||
|         type: "launcher", |  | ||||||
|         builtinWidget: "forwardInHistoryButton", |  | ||||||
|         icon: "bx bxs-chevron-right", |  | ||||||
|         attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] |  | ||||||
|     }, |  | ||||||
|     { id: "_lbMobileJumpTo", title: t("hidden-subtree.jump-to-note-title"), type: "launcher", command: "jumpToNote", icon: "bx bx-plus-circle" } |     { id: "_lbMobileJumpTo", title: t("hidden-subtree.jump-to-note-title"), type: "launcher", command: "jumpToNote", icon: "bx bx-plus-circle" } | ||||||
| ]; | ]; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran