Compare commits

..
7 Commits
Author SHA1 Message Date
Lncvrt 2e02275c29 1.5.5 2026-02-04 19:22:03 -07:00
Lncvrt dbaac6a6a6 Remove green & mint theme 2026-02-04 19:22:01 -07:00
Lncvrt 68525f161e Add a reinstall button for manage menu 2026-02-04 18:28:03 -07:00
Lncvrt d386454e91 Fix versions config not being set right when downloading 2026-02-04 17:58:07 -07:00
Lncvrt 6e05aac871 Fix games that can't even be installed showing up 2026-02-04 16:56:25 -07:00
Lncvrt fbe3feec9d Fix some issues 2026-02-04 16:47:54 -07:00
Lncvrt 1c540ad35b Fix eslint 2026-02-04 15:55:08 -07:00
11 changed files with 357 additions and 285 deletions

No files matched your search

+2 -1
View File
@@ -11,7 +11,8 @@ const eslintConfig = defineConfig([
'.next/**', '.next/**',
'out/**', 'out/**',
'build/**', 'build/**',
'next-env.d.ts' 'next-env.d.ts',
'src-tauri/**'
]) ])
]) ])
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "lncvrt-games-launcher", "name": "lncvrt-games-launcher",
"private": true, "private": true,
"version": "1.5.4", "version": "1.5.5",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "lncvrt-games-launcher" name = "lncvrt-games-launcher"
version = "1.5.4" version = "1.5.5"
authors = ["Lncvrt"] authors = ["Lncvrt"]
edition = "2024" edition = "2024"
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.4", "version": "1.5.5",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.4", "version": "1.5.5",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.4", "version": "1.5.5",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.4", "version": "1.5.5",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",
-24
View File
@@ -28,18 +28,6 @@ body {
--col8: rgb(152, 128, 128); --col8: rgb(152, 128, 128);
} }
.green-theme {
--col0: rgb(8, 32, 8);
--col1: rgb(16, 40, 16);
--col2: rgb(32, 56, 32);
--col3: rgb(48, 72, 48);
--col4: rgb(64, 88, 64);
--col5: rgb(80, 104, 80);
--col6: rgb(96, 120, 96);
--col7: rgb(112, 136, 112);
--col8: rgb(128, 152, 128);
}
.blue-theme { .blue-theme {
--col0: rgb(8, 8, 32); --col0: rgb(8, 8, 32);
--col1: rgb(16, 16, 40); --col1: rgb(16, 16, 40);
@@ -64,18 +52,6 @@ body {
--col8: rgb(140, 128, 152); --col8: rgb(140, 128, 152);
} }
.mint-theme {
--col0: rgb(8, 32, 16);
--col1: rgb(16, 48, 32);
--col2: rgb(32, 56, 40);
--col3: rgb(48, 72, 48);
--col4: rgb(64, 88, 66);
--col5: rgb(80, 104, 65);
--col6: rgb(96, 120, 80);
--col7: rgb(112, 136, 85);
--col8: rgb(128, 152, 95);
}
.button { .button {
@apply rounded-md cursor-pointer text-[16px] py-1 px-2 transition-colors border; @apply rounded-md cursor-pointer text-[16px] py-1 px-2 transition-colors border;
} }
+223 -162
View File
@@ -1,6 +1,6 @@
'use client' 'use client'
import { useEffect, useRef, useState } from 'react' import { useCallback, useEffect, useRef, useState } from 'react'
import Sidebar from './componets/Sidebar' import Sidebar from './componets/Sidebar'
import './Globals.css' import './Globals.css'
import { DownloadProgress } from './types/DownloadProgress' import { DownloadProgress } from './types/DownloadProgress'
@@ -111,15 +111,21 @@ export default function RootLayout ({
}) })
} }
function getVersionInfo (id: string | undefined): GameVersion | undefined { const getVersionInfo = useCallback(
if (!id) return undefined (id: string | undefined): GameVersion | undefined => {
return serverVersionList?.versions.find(v => v.id === id) if (!id) return undefined
} return serverVersionList?.versions.find(v => v.id === id)
},
[serverVersionList]
)
function getGameInfo (game: number | undefined): Game | undefined { const getGameInfo = useCallback(
if (!game) return undefined (game: number | undefined): Game | undefined => {
return serverVersionList?.games.find(g => g.id === game) if (!game) return undefined
} return serverVersionList?.games.find(g => g.id === game)
},
[serverVersionList]
)
function getListOfGames (): Game[] { function getListOfGames (): Game[] {
if (!downloadedVersionsConfig?.list) return [] if (!downloadedVersionsConfig?.list) return []
@@ -292,89 +298,96 @@ export default function RootLayout ({
return () => document.removeEventListener('contextmenu', handler) return () => document.removeEventListener('contextmenu', handler)
}, []) }, [])
async function downloadVersions ( const downloadVersions = useCallback(
list: string[], async (list: string[]): Promise<void> => {
currentConfig: VersionsConfig if (list.length === 0) return
): Promise<void> { setSelectedVersionList([])
if (list.length === 0) return
setSelectedVersionList([])
const newDownloads = list.map( const newDownloads = list.map(
version => version =>
new DownloadProgress(version, 0, 0, false, true, false, false, 0, 0) new DownloadProgress(version, 0, 0, false, true, false, false, 0, 0)
)
setDownloadProgress(newDownloads)
for (const download of newDownloads) {
const info = getVersionInfo(download.version)
if (!info) {
setDownloadProgress(prev =>
prev.filter(d => d.version !== download.version)
)
continue
}
const gameInfo = getGameInfo(info.game)
if (!gameInfo) {
setDownloadProgress(prev =>
prev.filter(d => d.version !== download.version)
)
continue
}
setDownloadProgress(prev =>
prev.map(d =>
d.version === download.version ? { ...d, queued: false } : d
)
) )
try { setDownloadProgress(newDownloads)
await axios.get(
'https://games.lncvrt.xyz/api/launcher/download?id=' + info.id
)
} catch {}
const res = await invoke<string>('download', { for (const download of newDownloads) {
url: info.downloadUrl, const info = getVersionInfo(download.version)
name: info.id, if (!info) {
executable: info.executable, setDownloadProgress(prev =>
hash: info.sha512sum prev.filter(d => d.version !== download.version)
}) )
continue
if (res === '1') {
setDownloadProgress(prev =>
prev.filter(d => d.version !== download.version)
)
const date = Date.now()
const newConfig = {
...currentConfig,
list: { ...currentConfig.list, [download.version]: date }
} }
setDownloadedVersionsConfig(newConfig)
writeVersionsConfig(newConfig) const gameInfo = getGameInfo(info.game)
} else { if (!gameInfo) {
setDownloadProgress(prev =>
prev.filter(d => d.version !== download.version)
)
continue
}
setDownloadProgress(prev => setDownloadProgress(prev =>
prev.map(d => prev.map(d =>
d.version === download.version d.version === download.version ? { ...d, queued: false } : d
? { ...d, queued: false, failed: true, progress: 0 }
: d
) )
) )
if (normalConfig?.settings.allowNotifications)
await notifyUser( try {
'Download Failed', await axios.get(
`The download for version ${info.displayName} has failed.` 'https://games.lncvrt.xyz/api/launcher/download?id=' + info.id
) )
} catch {}
const res = await invoke<string>('download', {
url: info.downloadUrl,
name: info.id,
executable: info.executable,
hash: info.sha512sum
})
if (res === '1') {
setDownloadProgress(prev =>
prev.filter(d => d.version !== download.version)
)
setDownloadedVersionsConfig(prev => {
if (!prev) return prev
const updated = {
...prev,
list: {
...prev.list,
[download.version]: Date.now()
}
}
writeVersionsConfig(updated)
return updated
})
} else {
setDownloadProgress(prev =>
prev.map(d =>
d.version === download.version
? { ...d, queued: false, failed: true, progress: 0 }
: d
)
)
if (normalConfig?.settings.allowNotifications)
await notifyUser(
'Download Failed',
`The download for version ${info.displayName} has failed.`
)
}
} }
}
if (normalConfig?.settings.allowNotifications) if (normalConfig?.settings.allowNotifications)
await notifyUser('Downloads Finished', 'All downloads have finished.') await notifyUser('Downloads Finished', 'All downloads have finished.')
setFadeOut(true) setFadeOut(true)
setTimeout(() => setShowPopup(false), 200) setTimeout(() => setShowPopup(false), 200)
} },
[getGameInfo, getVersionInfo, normalConfig]
)
useEffect(() => { useEffect(() => {
if (revisionCheck.current) return if (revisionCheck.current) return
@@ -402,9 +415,9 @@ export default function RootLayout ({
writeVersionsConfig(newConfig) writeVersionsConfig(newConfig)
setSelectedVersionList(prev => [...prev, ...versionsToSelect]) setSelectedVersionList(prev => [...prev, ...versionsToSelect])
await downloadVersions(versionsToSelect, newConfig) await downloadVersions(versionsToSelect)
})() })()
}, [serverVersionList, downloadedVersionsConfig]) }, [serverVersionList, downloadedVersionsConfig, downloadVersions])
return ( return (
<> <>
@@ -414,13 +427,9 @@ export default function RootLayout ({
normalConfig?.settings.theme === 1 normalConfig?.settings.theme === 1
? 'red-theme' ? 'red-theme'
: normalConfig?.settings.theme === 2 : normalConfig?.settings.theme === 2
? 'green-theme'
: normalConfig?.settings.theme === 3
? 'blue-theme' ? 'blue-theme'
: normalConfig?.settings.theme === 4 : normalConfig?.settings.theme === 3
? 'purple-theme' ? 'purple-theme'
: normalConfig?.settings.theme === 5
? 'mint-theme'
: 'dark-theme' : 'dark-theme'
} }
> >
@@ -591,81 +600,93 @@ export default function RootLayout ({
Select a game to download Select a game to download
</p> </p>
<div className='popup-content'> <div className='popup-content'>
{serverVersionList?.games.map((v, i) => ( {serverVersionList?.games
<div key={i} className='popup-entry'> .filter(v => {
<p className='text-2xl'>{v.name}</p> const data = getVersionsAmountData(v.id)
<div className='flex gap-2'> if (!data) return false
<div if (data.total > 0) return true
className='entry-info-item btntheme3' })
title='The amount of versions installed of this game in installed/installable format.' .map((v, i) => (
> <div key={i} className='popup-entry'>
<p> <p className='text-2xl'>{v.name}</p>
{(() => { <div className='flex gap-2'>
const data = getVersionsAmountData(v.id) <div
if (!data) return 'N/A' className='entry-info-item btntheme3'
return `${data.installed}/${data.total}` title='The amount of versions installed of this game in installed/installable format.'
})()}{' '} >
versions installed <p>
</p> {(() => {
</div> const data = getVersionsAmountData(
<div v.id
className='entry-info-item btntheme3' )
hidden={!v.official} if (!data) return 'N/A'
title='This game is official.' return `${data.installed}/${data.total}`
> })()}{' '}
<FontAwesomeIcon versions installed
icon={faCheck} </p>
color='#19c84b' </div>
/> <div
<p>Official</p> className='entry-info-item btntheme3'
</div> hidden={!v.official}
<div title='This game is official.'
className='entry-info-item btntheme3' >
hidden={v.official} <FontAwesomeIcon
title={ icon={faCheck}
v.verified color='#19c84b'
? 'This game is verified to be safe' />
: 'This game is NOT verified to be save. Proceed with caution.' <p>Official</p>
} </div>
> <div
<FontAwesomeIcon className='entry-info-item btntheme3'
icon={ hidden={v.official}
v.verified ? faShieldHalved : faWarning title={
v.verified
? 'This game is verified to be safe'
: 'This game is NOT verified to be save. Proceed with caution.'
} }
color={v.verified ? '#19c84b' : '#ffc800'} >
/> <FontAwesomeIcon
<p> icon={
{v.verified ? 'Verified' : 'Unverified'} v.verified
</p> ? faShieldHalved
: faWarning
}
color={
v.verified ? '#19c84b' : '#ffc800'
}
/>
<p>
{v.verified ? 'Verified' : 'Unverified'}
</p>
</div>
</div> </div>
<div
className='entry-info-item btntheme3 mt-2'
hidden={v.developer == null}
title={`The developer of ${v.name} is ${v.developer}.`}
>
<FontAwesomeIcon
icon={faCode}
color='lightgray'
/>
<p>Developer: {v.developer}</p>
</div>
<button
className='button btntheme3 right-2 bottom-2'
onClick={() => setSelectedGame(v.id)}
title={`Click to download specific versions of the game. You have ${(() => {
const data = getVersionsAmountData(v.id)
if (!data) return 'N/A'
return `${data.installed} of ${data.total}`
})()} versions downloaded.`}
>
<>
<FontAwesomeIcon icon={faDownload} />{' '}
Download
</>
</button>
</div> </div>
<div ))}
className='entry-info-item btntheme3 mt-2'
hidden={v.developer == null}
title={`The developer of ${v.name} is ${v.developer}.`}
>
<FontAwesomeIcon
icon={faCode}
color='lightgray'
/>
<p>Developer: {v.developer}</p>
</div>
<button
className='button btntheme3 right-2 bottom-2'
onClick={() => setSelectedGame(v.id)}
title={`Click to download specific versions of the game. You have ${(() => {
const data = getVersionsAmountData(v.id)
if (!data) return 'N/A'
return `${data.installed} of ${data.total}`
})()} versions downloaded.`}
>
<>
<FontAwesomeIcon icon={faDownload} />{' '}
Download
</>
</button>
</div>
))}
</div> </div>
</> </>
) : popupMode === 1 ? ( ) : popupMode === 1 ? (
@@ -799,6 +820,49 @@ export default function RootLayout ({
> >
Uninstall Uninstall
</button> </button>
<button
className='button btntheme2'
disabled={downloadProgress.length != 0}
onClick={async () => {
//uninstall
closePopup()
setDownloadedVersionsConfig(prev => {
if (!prev) return prev
const updatedList = Object.fromEntries(
Object.entries(prev.list).filter(
([k]) => k !== managingVersion
)
)
const updatedConfig = {
...prev,
list: updatedList
}
writeVersionsConfig(updatedConfig)
setManagingVersion(null)
setFadeOut(true)
setTimeout(() => setShowPopup(false), 200)
return updatedConfig
})
if (
await exists('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData
})
)
await remove('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
//reinstall
setSelectedVersionList([managingVersion])
downloadVersions([managingVersion])
}}
title="Click to reinstall this game. This will NOT remove any progress or any save files. This WILL uninstall any modifications to the game's executable files."
>
Reinstall
</button>
<button <button
className='button btntheme2' className='button btntheme2'
onClick={async () => onClick={async () =>
@@ -844,10 +908,7 @@ export default function RootLayout ({
setFadeOut(true) setFadeOut(true)
setTimeout(() => setShowPopup(false), 200) setTimeout(() => setShowPopup(false), 200)
if (downloadedVersionsConfig) if (downloadedVersionsConfig)
downloadVersions( downloadVersions(selectedVersionList)
selectedVersionList,
downloadedVersionsConfig
)
}} }}
disabled={downloadProgress.length != 0} disabled={downloadProgress.length != 0}
title={ title={
+98 -89
View File
@@ -50,24 +50,22 @@ export default function Settings () {
label='Allow sending notifications' label='Allow sending notifications'
value={allowNotifications} value={allowNotifications}
onChange={async () => { onChange={async () => {
while (normalConfig != null) { if (!normalConfig) return
setAllowNotifications(!allowNotifications) setAllowNotifications(!allowNotifications)
setNormalConfig({ setNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
allowNotifications: !allowNotifications allowNotifications: !allowNotifications
} }
}) })
writeNormalConfig({ await writeNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
allowNotifications: !allowNotifications allowNotifications: !allowNotifications
} }
}) })
break
}
}} }}
title='This setting does as you expect, allow the launcher to send notifications for when stuff like downloading is done.' title='This setting does as you expect, allow the launcher to send notifications for when stuff like downloading is done.'
/> />
@@ -75,24 +73,22 @@ export default function Settings () {
label='Always show games in sidebar' label='Always show games in sidebar'
value={alwaysShowGamesInSidebar} value={alwaysShowGamesInSidebar}
onChange={async () => { onChange={async () => {
while (normalConfig != null) { if (!normalConfig) return
setAlwaysShowGamesInSidebar(!alwaysShowGamesInSidebar) setAlwaysShowGamesInSidebar(!alwaysShowGamesInSidebar)
setNormalConfig({ setNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar
} }
}) })
writeNormalConfig({ await writeNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar alwaysShowGamesInSidebar: !alwaysShowGamesInSidebar
} }
}) })
break
}
}} }}
title="This setting will make it so when you are on a page like this, the games won't disappear." title="This setting will make it so when you are on a page like this, the games won't disappear."
/> />
@@ -100,24 +96,22 @@ export default function Settings () {
label='Show Installs/Launch/Manage Buttons' label='Show Installs/Launch/Manage Buttons'
value={useLegacyInteractButtons} value={useLegacyInteractButtons}
onChange={async () => { onChange={async () => {
while (normalConfig != null) { if (!normalConfig) return
setUseLegacyInteractButtons(!useLegacyInteractButtons) setUseLegacyInteractButtons(!useLegacyInteractButtons)
setNormalConfig({ setNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
useLegacyInteractButtons: !useLegacyInteractButtons useLegacyInteractButtons: !useLegacyInteractButtons
} }
}) })
writeNormalConfig({ await writeNormalConfig({
...normalConfig, ...normalConfig,
settings: { settings: {
...normalConfig.settings, ...normalConfig.settings,
useLegacyInteractButtons: !useLegacyInteractButtons useLegacyInteractButtons: !useLegacyInteractButtons
} }
}) })
break
}
}} }}
title='Enable the legacy method of using the installs/launch/manage buttons. In the future this setting may be removed so try and get used to the new method.' title='Enable the legacy method of using the installs/launch/manage buttons. In the future this setting may be removed so try and get used to the new method.'
/> />
@@ -125,13 +119,22 @@ export default function Settings () {
label='Use wine when needed to launch games' label='Use wine when needed to launch games'
value={useWineOnUnixWhenNeeded} value={useWineOnUnixWhenNeeded}
onChange={async () => { onChange={async () => {
while (normalConfig != null) { if (!normalConfig) return
setUseWineOnUnixWhenNeeded(!useWineOnUnixWhenNeeded) setUseWineOnUnixWhenNeeded(!useWineOnUnixWhenNeeded)
normalConfig.settings.useWineOnUnixWhenNeeded = setNormalConfig({
!useWineOnUnixWhenNeeded ...normalConfig,
await writeNormalConfig(normalConfig) settings: {
break ...normalConfig.settings,
} useWineOnUnixWhenNeeded: !useWineOnUnixWhenNeeded
}
})
await writeNormalConfig({
...normalConfig,
settings: {
...normalConfig.settings,
useWineOnUnixWhenNeeded: !useWineOnUnixWhenNeeded
}
})
}} }}
className={platform() == 'linux' ? '' : 'hidden'} className={platform() == 'linux' ? '' : 'hidden'}
/> />
@@ -142,12 +145,22 @@ export default function Settings () {
type='text' type='text'
value={wineOnUnixCommand} value={wineOnUnixCommand}
onChange={async e => { onChange={async e => {
while (normalConfig != null) { if (!normalConfig) return
setWineOnUnixCommand(e.target.value) setWineOnUnixCommand(e.target.value)
normalConfig.settings.wineOnUnixCommand = e.target.value setNormalConfig({
await writeNormalConfig(normalConfig) ...normalConfig,
break settings: {
} ...normalConfig.settings,
wineOnUnixCommand: e.target.value
}
})
await writeNormalConfig({
...normalConfig,
settings: {
...normalConfig.settings,
wineOnUnixCommand: e.target.value
}
})
}} }}
className={`input-field my-1 ${ className={`input-field my-1 ${
platform() == 'linux' && useWineOnUnixWhenNeeded ? '' : 'hidden' platform() == 'linux' && useWineOnUnixWhenNeeded ? '' : 'hidden'
@@ -159,33 +172,29 @@ export default function Settings () {
className='ml-2 bg-(--col2) border border-(--col4) rounded-md' className='ml-2 bg-(--col2) border border-(--col4) rounded-md'
value={theme} value={theme}
onChange={async e => { onChange={async e => {
if (!normalConfig) return
const newTheme = parseInt(e.target.value) const newTheme = parseInt(e.target.value)
while (normalConfig != null) { setTheme(newTheme)
setTheme(newTheme) setNormalConfig({
setNormalConfig({ ...normalConfig,
...normalConfig, settings: {
settings: { ...normalConfig.settings,
...normalConfig.settings, theme: newTheme
theme: newTheme }
} })
}) await writeNormalConfig({
writeNormalConfig({ ...normalConfig,
...normalConfig, settings: {
settings: { ...normalConfig.settings,
...normalConfig.settings, theme: newTheme
theme: newTheme }
} })
})
break
}
}} }}
> >
<option value={0}>Dark (default)</option> <option value={0}>Dark (default)</option>
<option value={1}>Red</option> <option value={1}>Red</option>
<option value={2}>Green</option> <option value={2}>Blue</option>
<option value={3}>Blue</option> <option value={3}>Purple</option>
<option value={4}>Purple</option>
<option value={5}>Mint</option>
</select> </select>
</div> </div>
</div> </div>
+28 -3
View File
@@ -32,7 +32,31 @@ export async function readNormalConfig (): Promise<NormalConfig> {
return new NormalConfig(version) return new NormalConfig(version)
} }
const config = await readTextFile('config.json', options) const config = await readTextFile('config.json', options)
return NormalConfig.import(JSON.parse(config)) const raw = JSON.parse(config)
if (
raw.settings &&
raw.settings.theme &&
(raw.version == '1.0.0' ||
raw.version == '1.1.0' ||
raw.version == '1.1.1' ||
raw.version == '1.2.0' ||
raw.version == '1.3.0' ||
raw.version == '1.3.1' ||
raw.version == '1.4.0' ||
raw.version == '1.5.0' ||
raw.version == '1.5.1' ||
raw.version == '1.5.2' ||
raw.version == '1.5.3' ||
raw.version == '1.5.4')
) {
const parsed = Number(raw.settings.theme)
if (parsed == 3) raw.settings.theme = 2
if (parsed == 4) raw.settings.theme = 3
else if (parsed != 0 && parsed != 1) raw.settings.theme = 0
}
raw.version = version
writeNormalConfig(raw)
return NormalConfig.import(raw)
} catch { } catch {
return new NormalConfig(version) return new NormalConfig(version)
} }
@@ -83,8 +107,7 @@ export async function readVersionsConfig (): Promise<VersionsConfig> {
} }
const config = await readTextFile('versions.json', options) const config = await readTextFile('versions.json', options)
const raw = JSON.parse(config) const raw = JSON.parse(config)
if (raw.version && raw.list && raw.timestamps) { if (raw.list && raw.timestamps) {
raw.version = version
raw.list = raw.timestamps raw.list = raw.timestamps
delete raw.timestamps delete raw.timestamps
@@ -94,6 +117,8 @@ export async function readVersionsConfig (): Promise<VersionsConfig> {
options options
) )
} }
raw.version = version
writeVersionsConfig(raw)
return VersionsConfig.import(raw) return VersionsConfig.import(raw)
} catch { } catch {
return new VersionsConfig(version) return new VersionsConfig(version)