Skip to content

Commit

Permalink
take "Almost All Mail" into account in some places
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Apr 20, 2024
1 parent 054584d commit 7763c5c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-mail",
"description": "Unofficial ProtonMail Desktop App",
"version": "5.2.2",
"version": "5.2.3",
"author": "Vladimir Yakovlev <[email protected]>",
"license": "GPL-3.0",
"homepage": "https://github.com/vladimiry/ElectronMail",
Expand Down
1 change: 1 addition & 0 deletions src/electron-main/database/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const resolveAccountFolders: resolveAccountFoldersType = (
// this folder should not affect the combined "unread" state calculation
// so "notify" should be set to 0/disabled since otherwise desktop notifications will always be displayed
SYSTEM_FOLDER_IDENTIFIERS["All Mail"],
SYSTEM_FOLDER_IDENTIFIERS["Almost All Mail"],
];
return (account, includingSpam) => [
...Object.values(account.folders),
Expand Down
6 changes: 4 additions & 2 deletions src/electron-preload/webview/primary/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ export function registerApi(providerApi: ProviderApi): void {
{system: [], custom: []},
);
const {id: mailId, conversationEntryPk: conversationId} = input.mail;
const [systemFolderId = systemMailFolderIds[0] /* falling back to first value if no other than "all mail" folder resolved */]
= systemMailFolderIds.filter((id) => id !== SYSTEM_FOLDER_IDENTIFIERS["All Mail"]);
// falling back to first value if no other than "all mail" folder resolved
const [systemFolderId = systemMailFolderIds[0]] = systemMailFolderIds.filter((id) => {
return id !== SYSTEM_FOLDER_IDENTIFIERS["All Mail"] && id !== SYSTEM_FOLDER_IDENTIFIERS["Almost All Mail"];
});
// TODO resolve "folder.id" value from the folder that contains a minimum items count
// so narrowest result if multiple items resolved (so protonmail will have to load less data, pagination thing)
const folderId: string | undefined =
Expand Down
1 change: 1 addition & 0 deletions src/shared/model/database/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const SYSTEM_FOLDER_IDENTIFIERS = buildEnumBundle({
Trash: "3",
Spam: "4",
["All Mail"]: "5",
["Almost All Mail"]: "15",
Starred: "10",
Archive: "6",
Sent: "7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class DbViewMailsSearchComponent extends DbViewAbstractComponent implemen
private readonly defaultUncheckedFolderIds: ReadonlySet<Unpacked<typeof SYSTEM_FOLDER_IDENTIFIERS._.values>> = new Set([
SYSTEM_FOLDER_IDENTIFIERS["Virtual Unread"],
SYSTEM_FOLDER_IDENTIFIERS["All Mail"],
SYSTEM_FOLDER_IDENTIFIERS["Almost All Mail"],
SYSTEM_FOLDER_IDENTIFIERS.Spam,
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class DbViewMailsComponent extends DbViewAbstractComponent implements OnI
SYSTEM_FOLDER_IDENTIFIERS["All Drafts"],
SYSTEM_FOLDER_IDENTIFIERS["All Sent"],
SYSTEM_FOLDER_IDENTIFIERS["All Mail"],
SYSTEM_FOLDER_IDENTIFIERS["Almost All Mail"],
SYSTEM_FOLDER_IDENTIFIERS.Search,
SYSTEM_FOLDER_IDENTIFIERS.Label,
]);
Expand Down

0 comments on commit 7763c5c

Please sign in to comment.