fix(editor): Cap NDV Output View Tab Index to prevent rare edge case (#11614)

This commit is contained in:
Charlie Kolb 2024-11-08 08:31:58 +01:00 committed by GitHub
parent d17d76a85d
commit a6c8ee4a82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -386,7 +386,10 @@ const currentOutputIndex = computed(() => {
return props.overrideOutputs[0];
}
return outputIndex.value;
// In some cases nodes may switch their outputCount while the user still
// has a higher outputIndex selected. We could adjust outputIndex directly,
// but that loses data as we can keep the user selection if the branch reappears.
return Math.min(outputIndex.value, maxOutputIndex.value);
});
const branches = computed(() => {
const capitalize = (name: string) => name.charAt(0).toLocaleUpperCase() + name.slice(1);