Skip to content

Commit

Permalink
Fix unsetting sticky mail ID
Browse files Browse the repository at this point in the history
  • Loading branch information
paw-hub committed Jan 24, 2025
1 parent 72a61ad commit 1ded82d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/mail-app/mail/view/MailViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import {
MailSetEntryTypeRef,
MailTypeRef,
} from "../../../common/api/entities/tutanota/TypeRefs.js"
import { elementIdPart, firstBiggerThanSecond, getElementId, isSameId, listIdPart } from "../../../common/api/common/utils/EntityUtils.js"
import {
deconstructMailSetEntryId,
elementIdPart,
firstBiggerThanSecond,
getElementId,
isSameId,
listIdPart,
} from "../../../common/api/common/utils/EntityUtils.js"
import {
assertNotNull,
count,
Expand Down Expand Up @@ -508,8 +515,8 @@ export class MailViewModel {
for (const update of updates) {
if (isUpdateForTypeRef(MailSetEntryTypeRef, update) && isSameId(folder.entries, update.instanceListId)) {
if (update.operation === OperationType.DELETE && this.stickyMailId != null) {
const entry = listModel.getMailSetEntry(update.instanceId)
if (entry && isSameId(entry.mail, this.stickyMailId)) {
const { mailId } = deconstructMailSetEntryId(update.instanceId)
if (isSameId(mailId, elementIdPart(this.stickyMailId))) {
// Reset target before we dispatch event to the list so that our handler in onListStateChange() has up-to-date state.
this.stickyMailId = null
}
Expand Down

0 comments on commit 1ded82d

Please sign in to comment.