mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 17:02:26 +08:00
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:
parent
676f0897ac
commit
5eca77dd70
@ -180,10 +180,6 @@ export default class NavItem extends EmberObject {
|
|||||||
item.init(item, category, args);
|
item.init(item, category, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.href) {
|
|
||||||
item.href = getURL(item.href);
|
|
||||||
}
|
|
||||||
|
|
||||||
const before = item.before;
|
const before = item.before;
|
||||||
if (before) {
|
if (before) {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
@ -198,7 +194,9 @@ export default class NavItem extends EmberObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item.customHref) {
|
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)) {
|
if (item.forceActive && item.forceActive(category, args)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user