Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit a808976

Browse files
committed
fix(packages/core): incorrect sidecar content may be presented
Fixes #3589
1 parent 5ce89aa commit a808976

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/core/src/webapp/bottom-stripe.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,16 @@ export const addModeButtons = (
362362
modesUnsorted.find(_ => _.mode === options.show).defaultMode = true
363363
}
364364

365-
if (options && options.modelOnly) {
366-
return modesUnsorted
367-
}
368-
369365
// obey the `order` constraints of the modes
370366
const modes = modesUnsorted.sort((a, b) => {
371367
return (a.order || 0) - (b.order || 0)
372368
})
373369

370+
// note: this must occur after the sort; see https://github.com/IBM/kui/issues/3589#issuecomment-581430878
371+
if (options && options.modelOnly) {
372+
return modesUnsorted
373+
}
374+
374375
// for going back
375376
const addModeButtons = (tab: Tab, modes: SidecarMode[], entity: MetadataBearing | CustomSpec, show: string) => {
376377
const modeStripe = css.modeContainer(tab)

0 commit comments

Comments
 (0)