mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin/develop' into port/client_ts
This commit is contained in:
		| @@ -8,6 +8,20 @@ function reloadFrontendApp(reason?: string) { | ||||
|     window.location.reload(); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Triggers the system tray to update its menu items, i.e. after a change in dynamic content such as bookmarks or recent notes. | ||||
|  * | ||||
|  * On any other platform than Electron, nothing happens. | ||||
|  */ | ||||
| function reloadTray() { | ||||
|     if (!isElectron()) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     const { ipcRenderer } = dynamicRequire("electron"); | ||||
|     ipcRenderer.send("reload-tray"); | ||||
| } | ||||
|  | ||||
| function parseDate(str: string) { | ||||
|     try { | ||||
|         return new Date(Date.parse(str)); | ||||
| @@ -124,6 +138,10 @@ function escapeHtml(str: string) { | ||||
|     return str.replace(/[&<>"'`=\/]/g, (s) => entityMap[s]); | ||||
| } | ||||
|  | ||||
| export function escapeQuotes(value: string) { | ||||
|     return value.replaceAll("\"", """); | ||||
| } | ||||
|  | ||||
| function formatSize(size: number) { | ||||
|     size = Math.max(Math.round(size / 1024), 1); | ||||
|  | ||||
| @@ -588,7 +606,10 @@ function compareVersions(v1: string, v2: string): number { | ||||
| /** | ||||
|  * Compares two semantic version strings and returns `true` if the latest version is greater than the current version. | ||||
|  */ | ||||
| function isUpdateAvailable(latestVersion: string, currentVersion: string): boolean { | ||||
| function isUpdateAvailable(latestVersion: string | null | undefined, currentVersion: string): boolean { | ||||
|     if (!latestVersion) { | ||||
|         return false; | ||||
|     } | ||||
|     return compareVersions(latestVersion, currentVersion) > 0; | ||||
| } | ||||
|  | ||||
| @@ -598,6 +619,7 @@ function isLaunchBarConfig(noteId: string) { | ||||
|  | ||||
| export default { | ||||
|     reloadFrontendApp, | ||||
|     reloadTray, | ||||
|     parseDate, | ||||
|     formatDateISO, | ||||
|     formatDateTime, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user