MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / handleInputChange

Function handleInputChange

web/src/pages/Channel/EditTagModal.js:57–109  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

55 const getInitValues = () => ({ ...originInputs });
56
57 const handleInputChange = (name, value) => {
58 setInputs((inputs) => ({ ...inputs, [name]: value }));
59 if (formApiRef.current) {
60 formApiRef.current.setValue(name, value);
61 }
62 if (name === 'type') {
63 let localModels = [];
64 switch (value) {
65 case 2:
66 localModels = [
67 'mj_imagine',
68 'mj_variation',
69 'mj_reroll',
70 'mj_blend',
71 'mj_upscale',
72 'mj_describe',
73 'mj_uploads',
74 ];
75 break;
76 case 5:
77 localModels = [
78 'swap_face',
79 'mj_imagine',
80 'mj_video',
81 'mj_edits',
82 'mj_variation',
83 'mj_reroll',
84 'mj_blend',
85 'mj_upscale',
86 'mj_describe',
87 'mj_zoom',
88 'mj_shorten',
89 'mj_modal',
90 'mj_inpaint',
91 'mj_custom_zoom',
92 'mj_high_variation',
93 'mj_low_variation',
94 'mj_pan',
95 'mj_uploads',
96 ];
97 break;
98 case 36:
99 localModels = ['suno_music', 'suno_lyrics'];
100 break;
101 default:
102 localModels = getChannelModels(value);
103 break;
104 }
105 if (inputs.models.length === 0) {
106 setInputs((inputs) => ({ ...inputs, models: localModels }));
107 }
108 }
109 };
110
111 const fetchModels = async () => {
112 try {

Callers 3

fetchTagModelsFunction · 0.70
addCustomModelsFunction · 0.70
EditTagModal.jsFile · 0.70

Calls 1

getChannelModelsFunction · 0.90

Tested by

no test coverage detected