mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +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() {
|
||||
let compareVersion = '1.2.49';
|
||||
function isBeforeFrontendVersion(compareVersion) {
|
||||
try {
|
||||
const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
|
||||
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);
|
||||
|
||||
var update_comfyui_button = null;
|
||||
@ -1516,7 +1518,10 @@ app.registerExtension({
|
||||
}).element
|
||||
);
|
||||
|
||||
app.menu?.settingsGroup.element.before(cmGroup.element);
|
||||
const shouldShowLegacyMenuItems = !isNewManagerUI();
|
||||
if (shouldShowLegacyMenuItems) {
|
||||
app.menu?.settingsGroup.element.before(cmGroup.element);
|
||||
}
|
||||
}
|
||||
catch(exception) {
|
||||
console.log('ComfyUI is outdated. New style menu based features are disabled.');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user