Make version switcher more obvious

This commit is contained in:
Misode
2022-06-12 20:51:54 +02:00
parent 01a95dd9d4
commit f944f4b617
11 changed files with 85 additions and 32 deletions

View File

@@ -22,7 +22,7 @@ export namespace Store {
return localStorage.getItem(ID_THEME) ?? 'dark'
}
export function getVersion(): VersionId {
export function getVersionOrDefault(): VersionId {
const version = localStorage.getItem(ID_VERSION)
if (version && VersionIds.includes(version as VersionId)) {
return version as VersionId
@@ -30,6 +30,14 @@ export namespace Store {
return '1.19'
}
export function getVersion(): VersionId | null {
const version = localStorage.getItem(ID_VERSION)
if (version && VersionIds.includes(version as VersionId)) {
return version as VersionId
}
return null
}
export function getIndent() {
return localStorage.getItem(ID_INDENT) ?? '2_spaces'
}