File size: 604 Bytes
c37b2dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { ComfyApp, app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js";

let refresh_btn = document.getElementById('comfy-refresh-button');
let refresh_btn2 = document.querySelector('button[title="Refresh widgets in nodes to find new models or files"]');

let orig = refresh_btn.onclick;

if(refresh_btn) {
    refresh_btn.onclick = function() {
        orig();
        api.fetchApi('/impact/wildcards/refresh');
    };
}

if(refresh_btn2) {
    refresh_btn2?.addEventListener('click', function() {
        api.fetchApi('/impact/wildcards/refresh');
    });
}