refactor: use function instead of static methods

This commit is contained in:
leejooy96 committed 2025-06-24 09:24:17 +09:00
1 parent df48a423af
commit f7bfd76e5e
1 file changed
+9 -13
+9 -13
View File
@@ -1,15 +1,11 @@
export default class Utils {
static getCurrentLocale(): string {
return navigator?.language?.split('-')[0] || 'en'
}
static async openExternal(url: string): Promise<void> {
await window.mainApi.send('msgOpenExternalLink', url)
}
static async openFile(type: string): Promise<any> {
return window.mainApi.invoke('msgOpenFile', type)
}
export function getCurrentLocale(): string {
return navigator?.language?.split('-')[0] || 'en'
}
export const { getCurrentLocale, openExternal, openFile } = Utils
export async function openExternal(url: string): Promise<void> {
await window.mainApi.send('msgOpenExternalLink', url)
}
export async function openFile(type: string): Promise<any> {
return window.mainApi.invoke('msgOpenFile', type)
}