2026-01-04 05:19:47 +05:00
|
|
|
import { invoke } from "@tauri-apps/api/core"
|
2023-06-11 19:18:58 +05:00
|
|
|
|
2026-01-04 22:50:34 +05:00
|
|
|
// ### UTILITY FUNCTIONS
|
2023-06-11 19:18:58 +05:00
|
|
|
|
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)
|
2023-06-11 19:18:58 +05:00
|
|
|
}
|
|
|
|
|
|
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))
|
2023-06-11 19:18:58 +05:00
|
|
|
}
|
|
|
|
|
|
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")
|
2023-06-11 19:18:58 +05:00
|
|
|
}
|
|
|
|
|
|
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()
|
|
|
|
|
}
|