Skip to content

Commit e0bc7be

Browse files
fix: prevent duplicated pinned items (#3878)
* feat: hide popover menu after user pinned a notebook * fix: disable pin option when a notebook is just pinned
1 parent e2cf9be commit e0bc7be

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/flows/components/FlowCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const FlowCards: FC<Props> = ({flows, search}) => {
4343
console.error(err.message)
4444
})
4545
}
46-
}, [])
46+
}, [flows])
4747

4848
return (
4949
<Grid>

src/flows/components/FlowContextMenu.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const FlowContextMenu: FC<Props> = ({id, name, isPinned}) => {
109109
enableDefaultStyles={false}
110110
style={{minWidth: '112px'}}
111111
triggerRef={settingsRef}
112-
contents={() => (
112+
contents={onHide => (
113113
<List>
114114
<List.Item
115115
onClick={handleClone}
@@ -121,7 +121,10 @@ const FlowContextMenu: FC<Props> = ({id, name, isPinned}) => {
121121
</List.Item>
122122
{isFlagEnabled('pinnedItems') && CLOUD && (
123123
<List.Item
124-
onClick={handlePinFlow}
124+
onClick={() => {
125+
handlePinFlow()
126+
onHide()
127+
}}
125128
size={ComponentSize.Small}
126129
style={{fontWeight: 500}}
127130
testID="context-pin-flow"

0 commit comments

Comments
 (0)