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