mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix resources path
This commit is contained in:
parent
c399e00aa4
commit
6b537085b4
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mihomo-party",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"description": "Mihomo Party",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "mihomo-party",
|
||||
|
||||
@ -12,7 +12,11 @@ export function resourcesDir(): string {
|
||||
if (is.dev) {
|
||||
return path.join(__dirname, '../../resources')
|
||||
} else {
|
||||
return path.join(app.getAppPath(), 'resources')
|
||||
if (app.getAppPath().endsWith('asar')) {
|
||||
return process.resourcesPath
|
||||
} else {
|
||||
return path.join(app.getAppPath(), 'resources')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,10 +54,10 @@ const DNS: React.FC = () => {
|
||||
setValues({ ...values, [type]: newValues })
|
||||
}
|
||||
const handleHostsChange = (domain: string, value: string, index: number): void => {
|
||||
const processValue = (val: string): string | string[] =>
|
||||
val.includes(',') ? val.split(',').map(s => s.trim()) : val.trim()
|
||||
const isEmpty = (d: string, v: string | string[]): boolean =>
|
||||
d === '' && (Array.isArray(v) ? v.every(item => item === '') : v === '')
|
||||
const processValue = (val: string): string | string[] =>
|
||||
val.includes(',') ? val.split(',').map((s) => s.trim()) : val.trim()
|
||||
const isEmpty = (d: string, v: string | string[]): boolean =>
|
||||
d === '' && (Array.isArray(v) ? v.every((item) => item === '') : v === '')
|
||||
|
||||
const newHosts = [...values.hosts]
|
||||
if (!isEmpty(domain.trim(), processValue(value))) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user