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

Commit 87d436a

Browse files
authored
fix(gui): navigate menu disabled on startup (#876)
1 parent 4c5b3f2 commit 87d436a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

api-editor/gui/src/features/menuBar/MenuBar.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
121121
dispatch(toggleComplete(declaration.id));
122122
};
123123
const goToPreviousMatch = () => {
124-
if (!declaration || currentUserAction !== NoUserAction) {
124+
if (!declaration || currentUserAction.type !== NoUserAction.type) {
125125
return;
126126
}
127127

@@ -152,7 +152,7 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
152152
}
153153
};
154154
const goToNextMatch = () => {
155-
if (!declaration || currentUserAction !== NoUserAction) {
155+
if (!declaration || currentUserAction.type !== NoUserAction.type) {
156156
return;
157157
}
158158

@@ -183,7 +183,7 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
183183
}
184184
};
185185
const goToParent = () => {
186-
if (!declaration || currentUserAction !== NoUserAction) {
186+
if (!declaration || currentUserAction.type !== NoUserAction.type) {
187187
return;
188188
}
189189

@@ -193,22 +193,22 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
193193
}
194194
};
195195
const expandAll = () => {
196-
if (currentUserAction === NoUserAction) {
196+
if (currentUserAction.type === NoUserAction.type) {
197197
dispatch(setAllExpandedInTreeView(getDescendantsOrSelf(pythonPackage)));
198198
}
199199
};
200200
const collapseAll = () => {
201-
if (currentUserAction === NoUserAction) {
201+
if (currentUserAction.type === NoUserAction.type) {
202202
dispatch(setAllCollapsedInTreeView(getDescendantsOrSelf(pythonPackage)));
203203
}
204204
};
205205
const expandSelected = () => {
206-
if (declaration && currentUserAction === NoUserAction) {
206+
if (declaration && currentUserAction.type === NoUserAction.type) {
207207
dispatch(setAllExpandedInTreeView(getDescendantsOrSelf(declaration)));
208208
}
209209
};
210210
const collapseSelected = () => {
211-
if (declaration && currentUserAction === NoUserAction) {
211+
if (declaration && currentUserAction.type === NoUserAction.type) {
212212
dispatch(setAllCollapsedInTreeView(getDescendantsOrSelf(declaration)));
213213
}
214214
};
@@ -345,7 +345,7 @@ export const MenuBar: React.FC<MenuBarProps> = function ({ displayInferErrors })
345345
<MenuButton
346346
as={Button}
347347
rightIcon={<Icon as={FaChevronDown} />}
348-
disabled={currentUserAction !== NoUserAction}
348+
disabled={currentUserAction.type !== NoUserAction.type}
349349
>
350350
Navigate
351351
</MenuButton>

0 commit comments

Comments
 (0)