Skip to content

Commit

Permalink
Fix being able to open Labels dropdown even if there are no labels
Browse files Browse the repository at this point in the history
The issue is being able to open labels dropdown even if there are no
labels.
Resolved by only showing dropdown if there are any labels found.

close #8141
  • Loading branch information
BijinDev committed Dec 30, 2024
1 parent 9b21c36 commit 5e6a75c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mail-app/mail/view/MailView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Dialog } from "../../../common/gui/base/Dialog"
import { FeatureType, getMailFolderType, Keys, MailSetKind } from "../../../common/api/common/TutanotaConstants"
import { AppHeaderAttrs, Header } from "../../../common/gui/Header.js"
import type { Mail, MailBox, MailFolder } from "../../../common/api/entities/tutanota/TypeRefs.js"
import { isEmpty, noOp, ofClass } from "@tutao/tutanota-utils"
import { assertNotNull, isEmpty, noOp, ofClass } from "@tutao/tutanota-utils"
import { MailListView } from "./MailListView"
import { assertMainOrNode, isApp } from "../../../common/api/common/Env"
import type { Shortcut } from "../../../common/misc/KeyManager"
Expand Down Expand Up @@ -586,12 +586,13 @@ export class MailView extends BaseTopLevelView implements TopLevelView<MailViewA
*/
private labels() {
const mailList = this.mailViewModel.listModel
if (mailList == null) {
if (mailList == null || !mailLocator.mailModel.canAssignLabels()) {
return
}

const labels = mailLocator.mailModel.getLabelStatesForMails(mailList.getSelectedAsArray())
const selectedMails = mailList.getSelectedAsArray()
if (isEmpty(selectedMails)) {

if (isEmpty(labels) || isEmpty(selectedMails)) {
return
}

Expand Down

0 comments on commit 5e6a75c

Please sign in to comment.