mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 00:17:17 +08:00
add fallback logic when find no JobSource enabled
This commit is contained in:
@@ -155,18 +155,9 @@ if (
|
|||||||
let {
|
let {
|
||||||
jobSourceList
|
jobSourceList
|
||||||
} = readConfigFile('boss.json')
|
} = readConfigFile('boss.json')
|
||||||
|
|
||||||
if (!jobSourceList?.length) {
|
|
||||||
jobSourceList = [
|
|
||||||
{
|
|
||||||
type: "expect",
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
const normalizedJobSource = []
|
const normalizedJobSource = []
|
||||||
const addedSourceSet = new Set()
|
const addedSourceSet = new Set()
|
||||||
for (const source of jobSourceList) {
|
for (const source of (jobSourceList ?? [])) {
|
||||||
if (addedSourceSet.has(source.type)) {
|
if (addedSourceSet.has(source.type)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -200,6 +191,11 @@ for (const source of jobSourceList) {
|
|||||||
addedSourceSet.add(source.type)
|
addedSourceSet.add(source.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!normalizedJobSource?.length) {
|
||||||
|
normalizedJobSource.push({
|
||||||
|
type: 'expect'
|
||||||
|
})
|
||||||
|
}
|
||||||
const localStoragePageUrl = `https://www.zhipin.com/desktop/`
|
const localStoragePageUrl = `https://www.zhipin.com/desktop/`
|
||||||
const recommendJobPageUrl = `https://www.zhipin.com/web/geek/jobs`
|
const recommendJobPageUrl = `https://www.zhipin.com/web/geek/jobs`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user