mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 18:33:05 +08:00
don't show menu buttons if past comfyui front 1.16
This commit is contained in:
parent
b4392293fa
commit
ad14e1ed13
@ -189,8 +189,7 @@ docStyle.innerHTML = `
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function is_legacy_front() {
|
function isBeforeFrontendVersion(compareVersion) {
|
||||||
let compareVersion = '1.2.49';
|
|
||||||
try {
|
try {
|
||||||
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
|
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
|
||||||
if (typeof frontendVersion !== 'string') {
|
if (typeof frontendVersion !== 'string') {
|
||||||
@ -223,6 +222,9 @@ function is_legacy_front() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const is_legacy_front = isBeforeFrontendVersion('1.2.49');
|
||||||
|
const isNewManagerUI = () => isBeforeFrontendVersion('1.16.4');
|
||||||
|
|
||||||
document.head.appendChild(docStyle);
|
document.head.appendChild(docStyle);
|
||||||
|
|
||||||
var update_comfyui_button = null;
|
var update_comfyui_button = null;
|
||||||
@ -1516,7 +1518,10 @@ app.registerExtension({
|
|||||||
}).element
|
}).element
|
||||||
);
|
);
|
||||||
|
|
||||||
app.menu?.settingsGroup.element.before(cmGroup.element);
|
const shouldShowLegacyMenuItems = !isNewManagerUI();
|
||||||
|
if (shouldShowLegacyMenuItems) {
|
||||||
|
app.menu?.settingsGroup.element.before(cmGroup.element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(exception) {
|
catch(exception) {
|
||||||
console.log('ComfyUI is outdated. New style menu based features are disabled.');
|
console.log('ComfyUI is outdated. New style menu based features are disabled.');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user