diff --git a/web/src/components/ExpandedViewMode/ExpandedViewMode.component.tsx b/web/src/components/ExpandedViewMode/ExpandedViewMode.component.tsx index 825ff6e7..a2e101a1 100644 --- a/web/src/components/ExpandedViewMode/ExpandedViewMode.component.tsx +++ b/web/src/components/ExpandedViewMode/ExpandedViewMode.component.tsx @@ -73,6 +73,18 @@ const ExpandedViewMode: React.FC = ({ } }, [outcomeActionHash]) + useEffect(() => { + if (outcome) { + // make sure that a section that isn't available, based on changes + // to the Outcome, isn't shown + if ('Small' in outcome.scope && activeTab === ExpandedViewTab.ChildrenList) { + setActiveTab(ExpandedViewTab.TaskList) + } else if ('Uncertain' in outcome.scope && activeTab === ExpandedViewTab.TaskList) { + setActiveTab(ExpandedViewTab.ChildrenList) + } + } + }, [outcome, activeTab, setActiveTab]) + const outcomeId = hashCodeId(outcomeActionHash) // if not small, then show children list icon on left menu diff --git a/web/src/components/MapViewCreateOutcome/MapViewCreateOutcome.component.tsx b/web/src/components/MapViewCreateOutcome/MapViewCreateOutcome.component.tsx index c62a291f..32cf5d7a 100644 --- a/web/src/components/MapViewCreateOutcome/MapViewCreateOutcome.component.tsx +++ b/web/src/components/MapViewCreateOutcome/MapViewCreateOutcome.component.tsx @@ -3,14 +3,6 @@ import useOnClickOutside from 'use-onclickoutside' import TextareaAutosize from 'react-textarea-autosize' import moment from 'moment' -import { - firstZoomThreshold, - fontSize, - fontSizeExtraLarge, - fontSizeLarge, - lineHeightMultiplier, - secondZoomThreshold, -} from '../../drawing/dimensions' import './MapViewCreateOutcome.scss' import { AgentPubKeyB64, @@ -18,8 +10,7 @@ import { ActionHashB64, Option, } from '../../types/shared' -import { LinkedOutcomeDetails, Outcome, RelationInput } from '../../types' -import Checkbox from '../Checkbox/Checkbox' +import { LinkedOutcomeDetails, Outcome } from '../../types' import ButtonCheckbox from '../ButtonCheckbox/ButtonCheckbox' import { coordsCanvasToPage } from '../../drawing/coordinateSystems' import Icon from '../Icon/Icon'