Skip to content

Commit

Permalink
check if breadcrumbs should update by name (which changes), not ID
Browse files Browse the repository at this point in the history
  • Loading branch information
John Mitchell authored and John Mitchell committed Jan 20, 2021
1 parent db793f3 commit 84912c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions awx/ui_next/src/screens/Inventory/Inventories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ function Inventories({ i18n }) {

const setBreadcrumbConfig = useCallback(
(passedInventory, passedNestedObject, passedSchedule) => {
if (passedInventory && passedInventory.id !== inventory?.id) {
if (passedInventory && passedInventory.name !== inventory?.name) {
setInventory(passedInventory);
}
if (passedNestedObject && passedNestedObject.id !== nestedObject?.id) {
if (passedNestedObject && passedNestedObject.name !== nestedObject?.name) {
setNestedGroup(passedNestedObject);
}
if (passedSchedule && passedSchedule.id !== schedule?.id) {
if (passedSchedule && passedSchedule.name !== schedule?.name) {
setSchedule(passedSchedule);
}
if (!inventory) {
Expand Down
4 changes: 2 additions & 2 deletions awx/ui_next/src/screens/Template/Templates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ function Templates({ i18n }) {

const setBreadcrumbConfig = useCallback(
(passedTemplate, passedSchedule) => {
if (passedTemplate && passedTemplate.id !== template?.id) {
if (passedTemplate && passedTemplate.name !== template?.name) {
setTemplate(passedTemplate);
}
if (passedSchedule && passedSchedule.id !== schedule?.id) {
if (passedSchedule && passedSchedule.name !== schedule?.name) {
setSchedule(passedSchedule);
}
if (!template) return;
Expand Down

0 comments on commit 84912c5

Please sign in to comment.