1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-03 15:39:54 +08:00

Remove hard coded max_items in history API

This commit is contained in:
Jack Bauer
2023-11-26 17:23:11 +04:00
committed by GitHub
parent 39e75862b2
commit 6aa1bcd601

View File

@@ -254,9 +254,9 @@ class ComfyApi extends EventTarget {
* Gets the prompt execution history * Gets the prompt execution history
* @returns Prompt history including node outputs * @returns Prompt history including node outputs
*/ */
async getHistory() { async getHistory(max_items=200) {
try { try {
const res = await this.fetchApi("/history?max_items=200"); const res = await this.fetchApi(`/history?max_items=${max_items}`);
return { History: Object.values(await res.json()) }; return { History: Object.values(await res.json()) };
} catch (error) { } catch (error) {
console.error(error); console.error(error);