Skip to content

Commit

Permalink
chore: fix a typo in #getOrCategoryEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarpl authored Dec 11, 2024
1 parent 31d72ff commit 29c0800
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class NotificationsModelHelper implements INotificationsModel {
}

async getAllNotifications(category: string): Promise<INotificationWithTarget[]> {
const notificationsForCategory = this.#getOrCategoryEntry(category)
const notificationsForCategory = this.#getOrCreateCategoryEntry(category)

await this.#getAllNotificationsRaw(notificationsForCategory, category)

Expand Down Expand Up @@ -98,14 +98,14 @@ export class NotificationsModelHelper implements INotificationsModel {
}

clearNotification(category: string, notificationId: string): void {
const notificationsForCategory = this.#getOrCategoryEntry(category)
const notificationsForCategory = this.#getOrCreateCategoryEntry(category)

// The notification may or may not be loaded, but this indicates that to the saving that we intend to delete it
notificationsForCategory.updatedNotifications.set(notificationId, null)
}

setNotification(category: string, notification: INotificationWithTarget): void {
const notificationsForCategory = this.#getOrCategoryEntry(category)
const notificationsForCategory = this.#getOrCreateCategoryEntry(category)

const fullCategory = this.#getFullCategoryName(category)
notificationsForCategory.updatedNotifications.set(notification.id, {
Expand All @@ -119,7 +119,7 @@ export class NotificationsModelHelper implements INotificationsModel {
}

clearAllNotifications(category: string): void {
const notificationsForCategory = this.#getOrCategoryEntry(category)
const notificationsForCategory = this.#getOrCreateCategoryEntry(category)

// Tell this store that any documents not in the `updatedNotifications` should be deleted
notificationsForCategory.removeAllMissing = true
Expand All @@ -128,7 +128,7 @@ export class NotificationsModelHelper implements INotificationsModel {
notificationsForCategory.updatedNotifications.clear()
}

#getOrCategoryEntry(category: string): NotificationsLoadState {
#getOrCreateCategoryEntry(category: string): NotificationsLoadState {
let notificationsForCategory = this.#notificationsByCategory.get(category)
if (!notificationsForCategory) {
notificationsForCategory = {
Expand Down

0 comments on commit 29c0800

Please sign in to comment.