File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 149149 }
150150
151151 async function copyCommand (command ) {
152- copiedCommand = command
153152 copyFallbackCommand = undefined
154153
155154 try {
156155 await navigator .clipboard .writeText (command)
156+ copiedCommand = command
157157 window .setTimeout (() => {
158158 if (copiedCommand === command) copiedCommand = undefined
159159 }, 1800 )
160160 } catch {
161+ copiedCommand = undefined
161162 copyFallbackCommand = command
162163 window .prompt ($LL .download .copyPrompt (), command)
163164 }
Original file line number Diff line number Diff line change 1- import { baseLocale , locales as generatedLocales } from '../i18n/i18n-util'
1+ import { baseLocale , isLocale , locales as generatedLocales } from '../i18n/i18n-util'
22import type { Locales } from '../i18n/i18n-types'
33
44type LocaleOption = {
@@ -22,7 +22,7 @@ export const localeStorageKey = 'serverbox.website.locale'
2222
2323export function normalizeLocale ( locale : string | null | undefined ) : Locales {
2424 if ( ! locale ) return defaultLocale
25- if ( generatedLocales . includes ( locale as Locales ) ) return locale as Locales
25+ if ( isLocale ( locale ) ) return locale
2626
2727 const lowerLocale = locale . toLowerCase ( )
2828 if ( lowerLocale . startsWith ( 'zh' ) ) return 'zh-CN'
You can’t perform that action at this time.
0 commit comments