J.A.R.V.I.S-rust/frontend/src/functions.ts

28 lines
845 B
TypeScript
Raw Normal View History

import { invoke } from "@tauri-apps/api/core"
2026-01-04 22:50:34 +05:00
// ### UTILITY FUNCTIONS
2026-01-04 22:50:34 +05:00
export function capitalizeFirstLetter(str: string): string {
if (!str) return ""
return str.charAt(0).toUpperCase() + str.slice(1)
}
2026-01-04 22:50:34 +05:00
export function showInExplorer(path: string): void {
invoke("show_in_folder", { path })
.catch(err => console.error("failed to open explorer:", err))
}
2026-01-04 22:50:34 +05:00
// ### LISTENER FUNCTIONS
// removed since gui now doesn't handle listening
export function startListening(): void {
// disabled in GUI - listening is handled by the tray app
console.log("[gui] listening not available in settings app")
}
2026-01-04 22:50:34 +05:00
export function stopListening(callback?: () => void): void {
// disabled in GUI - just call the callback if provided
console.log("[gui] listening not available in settings app")
if (callback) callback()
}