Skip to content

Commit

Permalink
Add digests attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
twobiers authored Apr 1, 2024
1 parent a43aab8 commit f0d6f4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/module/NotificationCenter/NotificationCenter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import template from "../../../assets/template/notificationCenter.html?raw";
import templateEntry from "../../../assets/template/notificationEntry.html?raw";
import { ModuleSetting, PoweruserModule } from "@/types";
import { ModuleSetting, PoweruserModule, UserInbox } from "@/types";
import Utils, { loadStyle } from "@/Utils";
import style from "./notificationCenter.less?inline";
import Settings from "@/core/Settings/Settings";
Expand Down Expand Up @@ -86,7 +86,8 @@ export default class NotificationCenter implements PoweruserModule {
messages: 0,
comments: 0,
follows: 0,
});
digests: 0
} as UserInbox);

if (unreadMessages <= 0) {
let elem = document.createElement("li");
Expand Down
17 changes: 10 additions & 7 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,20 @@ export type GlobalPr0Config = {
HEADER_HEIGHT: number;
}

export type UserInbox = {
comments: number;
mentions: number;
messages: number;
notifications: number;
follows: number;
digests: number;
}

export type UserSyncEvent = {
type: "userSync";
data: {
score: number;
inbox: {
comments: number;
mentions: number;
messages: number;
notifications: number;
follows: number;
}
inbox: UserInbox;
}
};

Expand Down

0 comments on commit f0d6f4e

Please sign in to comment.