mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
Fix handling of templates index.json not found (#2842)
This commit is contained in:
@@ -420,7 +420,8 @@ export class ComfyApi extends EventTarget {
|
||||
*/
|
||||
async getCoreWorkflowTemplates(): Promise<WorkflowTemplates[]> {
|
||||
const res = await axios.get('/templates/index.json')
|
||||
return res.status === 200 ? res.data : []
|
||||
const contentType = res.headers['content-type']
|
||||
return contentType?.includes('application/json') ? res.data : []
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user