UX: Don't block render of user messages secondary nav for tracking state (#21965)
Why is this change required? Right now, we're awaiting on the promise returned by `this.pmTopicTrackingState.startTracking()` which blocks the rendering of the template until the promise resolves. However, this blocking of the rendering ends up introducing yet another intermediate loading state in the UI which we find unsightly. Instead of blocking the rendering, we allow the promise to resolve in the background and display the new/unread counts when the promise resolves.
This commit is contained in:
parent
fc296b9a81
commit
9a18c8032a
|
@ -11,7 +11,8 @@ export default class extends Controller {
|
|||
|
||||
@computed(
|
||||
"pmTopicTrackingState.newIncoming.[]",
|
||||
"pmTopicTrackingState.statesModificationCounter"
|
||||
"pmTopicTrackingState.statesModificationCounter",
|
||||
"pmTopicTrackingState.isTracking"
|
||||
)
|
||||
get newLinkText() {
|
||||
return this.#linkText("new");
|
||||
|
@ -19,7 +20,8 @@ export default class extends Controller {
|
|||
|
||||
@computed(
|
||||
"pmTopicTrackingState.newIncoming.[]",
|
||||
"pmTopicTrackingState.statesModificationCounter"
|
||||
"pmTopicTrackingState.statesModificationCounter",
|
||||
"pmTopicTrackingState.isTracking"
|
||||
)
|
||||
get unreadLinkText() {
|
||||
return this.#linkText("unread");
|
||||
|
|
|
@ -22,7 +22,8 @@ export default class extends Controller {
|
|||
|
||||
@computed(
|
||||
"pmTopicTrackingState.newIncoming.[]",
|
||||
"pmTopicTrackingState.statesModificationCounter"
|
||||
"pmTopicTrackingState.statesModificationCounter",
|
||||
"pmTopicTrackingState.isTracking"
|
||||
)
|
||||
get newLinkText() {
|
||||
return this.#linkText("new");
|
||||
|
@ -30,7 +31,8 @@ export default class extends Controller {
|
|||
|
||||
@computed(
|
||||
"pmTopicTrackingState.newIncoming.[]",
|
||||
"pmTopicTrackingState.statesModificationCounter"
|
||||
"pmTopicTrackingState.statesModificationCounter",
|
||||
"pmTopicTrackingState.isTracking"
|
||||
)
|
||||
get unreadLinkText() {
|
||||
return this.#linkText("unread");
|
||||
|
|
|
@ -8,12 +8,8 @@ export default DiscourseRoute.extend({
|
|||
templateName: "user/messages",
|
||||
composer: service(),
|
||||
|
||||
model() {
|
||||
return this.modelFor("user");
|
||||
},
|
||||
|
||||
afterModel() {
|
||||
return this.pmTopicTrackingState.startTracking();
|
||||
this.pmTopicTrackingState.startTracking();
|
||||
},
|
||||
|
||||
setupController() {
|
||||
|
|
Loading…
Reference in New Issue