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
+3 -7
+3 -7
View File
@@ -1,15 +1,11 @@
export default class Utils { export function getCurrentLocale(): string {
static getCurrentLocale(): string {
return navigator?.language?.split('-')[0] || 'en' return navigator?.language?.split('-')[0] || 'en'
} }
static async openExternal(url: string): Promise<void> { export async function openExternal(url: string): Promise<void> {
await window.mainApi.send('msgOpenExternalLink', url) await window.mainApi.send('msgOpenExternalLink', url)
} }
static async openFile(type: string): Promise<any> { export async function openFile(type: string): Promise<any> {
return window.mainApi.invoke('msgOpenFile', type) return window.mainApi.invoke('msgOpenFile', type)
} }
}
export const { getCurrentLocale, openExternal, openFile } = Utils