FIX: ensures href is not set two times (#28466)

This would cause the infamous error:

```
index.js:118 Uncaught (in promise)
Error: Assertion Failed: You attempted to update `href` on `<ExtraNavItem:ember384>`, but it had already been used previously in the same computation.
```

Moreover, set didnt seem necessary here.
This commit is contained in:
Joffrey JAFFEUX 2024-08-21 20:27:21 +02:00 committed by GitHub
parent 676f0897ac
commit 5eca77dd70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,10 +180,6 @@ export default class NavItem extends EmberObject {
item.init(item, category, args);
}
if (item.href) {
item.href = getURL(item.href);
}
const before = item.before;
if (before) {
let i = 0;
@ -198,7 +194,9 @@ export default class NavItem extends EmberObject {
}
if (item.customHref) {
item.set("href", item.customHref(category, args));
item.href = item.customHref(category, args);
} else if (item.href) {
item.href = getURL(item.href);
}
if (item.forceActive && item.forceActive(category, args)) {