This commit adds the number of drafts a user has next to the "Draft" label in the user preferences menu and activity tab. The count is updated via MessageBus when a draft is created or destroyed.
16 lines
330 B
JavaScript
16 lines
330 B
JavaScript
export default {
|
|
name: "subscribe-user-changes",
|
|
after: "message-bus",
|
|
|
|
initialize(container) {
|
|
const user = container.lookup("current-user:main");
|
|
|
|
if (user) {
|
|
const bus = container.lookup("message-bus:main");
|
|
bus.subscribe("/user", (data) => {
|
|
user.setProperties(data);
|
|
});
|
|
}
|
|
},
|
|
};
|