mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-24 07:08:13 -05:00
9d4d605acf
ISSUES CLOSED: #310
20 lines
533 B
TypeScript
20 lines
533 B
TypeScript
import picgo from './picgo'
|
|
|
|
const getPicBeds = () => {
|
|
const picBedTypes = picgo.helper.uploader.getIdList()
|
|
const picBedFromDB = picgo.getConfig('picBed.list') || []
|
|
const picBeds = picBedTypes.map((item: string) => {
|
|
const visible = picBedFromDB.find((i: IPicBedType) => i.type === item) // object or undefined
|
|
return {
|
|
type: item,
|
|
name: picgo.helper.uploader.get(item).name || item,
|
|
visible: visible ? visible.visible : true
|
|
}
|
|
}) as IPicBedType[]
|
|
return picBeds
|
|
}
|
|
|
|
export {
|
|
getPicBeds
|
|
}
|