FIX: error when opening a previously deleted post (#19346)
The repro for the bug: Add a post with a mention of a user Post another post below Delete the first post with a mention Reload the page and try to attempt to view hidden reply
This commit is contained in:
parent
b341f75400
commit
26a45e8166
|
@ -396,6 +396,7 @@ export default RestModel.extend({
|
||||||
if (postIdx !== -1) {
|
if (postIdx !== -1) {
|
||||||
return this.findPostsByIds(headGap).then((posts) => {
|
return this.findPostsByIds(headGap).then((posts) => {
|
||||||
posts.forEach((p) => {
|
posts.forEach((p) => {
|
||||||
|
this._initUserModels(p);
|
||||||
const stored = this.storePost(p);
|
const stored = this.storePost(p);
|
||||||
if (!currentPosts.includes(stored)) {
|
if (!currentPosts.includes(stored)) {
|
||||||
currentPosts.insertAt(postIdx++, stored);
|
currentPosts.insertAt(postIdx++, stored);
|
||||||
|
|
|
@ -69,7 +69,7 @@ export default class PostCooked {
|
||||||
this._insertQuoteControls(cookedDiv);
|
this._insertQuoteControls(cookedDiv);
|
||||||
this._showLinkCounts(cookedDiv);
|
this._showLinkCounts(cookedDiv);
|
||||||
this._applySearchHighlight(cookedDiv);
|
this._applySearchHighlight(cookedDiv);
|
||||||
this._initUserStatusToMentions();
|
this._initUserStatusOnMentions();
|
||||||
this._decorateAndAdopt(cookedDiv);
|
this._decorateAndAdopt(cookedDiv);
|
||||||
|
|
||||||
return cookedDiv;
|
return cookedDiv;
|
||||||
|
@ -374,7 +374,7 @@ export default class PostCooked {
|
||||||
return cookedDiv;
|
return cookedDiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
_initUserStatusToMentions() {
|
_initUserStatusOnMentions() {
|
||||||
if (!this._isInComposerPreview) {
|
if (!this._isInComposerPreview) {
|
||||||
this._trackMentionedUsersStatus();
|
this._trackMentionedUsersStatus();
|
||||||
this._rerenderUserStatusOnMentions();
|
this._rerenderUserStatusOnMentions();
|
||||||
|
|
Loading…
Reference in New Issue