fix first run startup failure

This commit is contained in:
pompurin404 2024-08-11 11:30:00 +08:00
parent 7ab035d9ba
commit 18e4a9ab70
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View File

@ -181,6 +181,6 @@ export async function setProfileStr(id: string, content: string): Promise<void>
}
}
export function getProfile(id: string): IMihomoConfig {
return yaml.parse(getProfileStr(id))
export function getProfile(id: string | undefined): IMihomoConfig {
return yaml.parse(getProfileStr(id || 'default'))
}

View File

@ -5,7 +5,6 @@ import fs from 'fs'
export function generateProfile(): void {
const current = getProfileConfig().current
if (!current) return
const currentProfile = getProfile(current)
const controledMihomoConfig = getControledMihomoConfig()
const { tun: profileTun = {} } = currentProfile