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