mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix
This commit is contained in:
parent
93155cedfb
commit
75d064f4e1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mihomo-party",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Mihomo Party",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "mihomo-party",
|
||||
|
||||
@ -95,7 +95,11 @@ async function cleanup(): Promise<void> {
|
||||
const files = await readdir(dataDir())
|
||||
for (const file of files) {
|
||||
if (file.endsWith('.exe') || file.endsWith('.dmg')) {
|
||||
await rm(path.join(dataDir(), file))
|
||||
try {
|
||||
await rm(path.join(dataDir(), file))
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
// logs
|
||||
@ -105,7 +109,11 @@ async function cleanup(): Promise<void> {
|
||||
const date = new Date(log.split('.')[0])
|
||||
const diff = Date.now() - date.getTime()
|
||||
if (diff > maxLogDays * 24 * 60 * 60 * 1000) {
|
||||
await rm(path.join(logDir(), log))
|
||||
try {
|
||||
await rm(path.join(logDir(), log))
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,9 @@ const Mihomo: React.FC = () => {
|
||||
try {
|
||||
setUpgrading(true)
|
||||
await mihomoUpgrade()
|
||||
PubSub.publish('mihomo-core-changed')
|
||||
setTimeout(() => {
|
||||
PubSub.publish('mihomo-core-changed')
|
||||
}, 2000)
|
||||
} catch (e) {
|
||||
alert(e)
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user