File tree 2 files changed +27
-22
lines changed
2 files changed +27
-22
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,7 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
242
242
reportIDRef . current = '-1' ;
243
243
reportActionIDRef . current = '-1' ;
244
244
originalReportIDRef . current = '-1' ;
245
+ setInstanceID ( '' ) ;
245
246
246
247
onPopoverHide . current = runAndResetCallback ( onPopoverHide . current ) ;
247
248
onPopoverHideActionCallback . current = runAndResetCallback ( onPopoverHideActionCallback . current ) ;
Original file line number Diff line number Diff line change @@ -123,33 +123,37 @@ function showContextMenu(
123
123
if ( ! contextMenuRef . current ) {
124
124
return ;
125
125
}
126
+ const show = ( ) => {
127
+ contextMenuRef . current ?. showContextMenu (
128
+ type ,
129
+ event ,
130
+ selection ,
131
+ contextMenuAnchor ,
132
+ reportID ,
133
+ reportActionID ,
134
+ originalReportID ,
135
+ draftMessage ,
136
+ onShow ,
137
+ onHide ,
138
+ isArchivedRoom ,
139
+ isChronosReport ,
140
+ isPinnedChat ,
141
+ isUnreadChat ,
142
+ disabledActions ,
143
+ shouldCloseOnTarget ,
144
+ setIsEmojiPickerActive ,
145
+ isOverflowMenu ,
146
+ ) ;
147
+ } ;
148
+
126
149
// If there is an already open context menu, close it first before opening
127
150
// a new one.
128
151
if ( contextMenuRef . current . instanceID ) {
129
- hideContextMenu ( ) ;
130
- contextMenuRef . current . runAndResetOnPopoverHide ( ) ;
152
+ hideContextMenu ( false , show ) ;
153
+ return ;
131
154
}
132
155
133
- contextMenuRef . current . showContextMenu (
134
- type ,
135
- event ,
136
- selection ,
137
- contextMenuAnchor ,
138
- reportID ,
139
- reportActionID ,
140
- originalReportID ,
141
- draftMessage ,
142
- onShow ,
143
- onHide ,
144
- isArchivedRoom ,
145
- isChronosReport ,
146
- isPinnedChat ,
147
- isUnreadChat ,
148
- disabledActions ,
149
- shouldCloseOnTarget ,
150
- setIsEmojiPickerActive ,
151
- isOverflowMenu ,
152
- ) ;
156
+ show ( ) ;
153
157
}
154
158
155
159
/**
You can’t perform that action at this time.
0 commit comments