mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-03 16:07:32 +00:00
The drawer showed "All inboxes" and the Unified section as soon as a second account was signed in, but with cross-account off the unified views only cover the active account, so they repeated its own folders. They now follow the webmail's rule: shown with cross-account on and several accounts, or when group inboxes are merged in.
21 lines
874 B
TypeScript
21 lines
874 B
TypeScript
/**
|
|
* Whether the drawer offers the unified mailbox (the "All inboxes" row and
|
|
* the Unified section), following the webmail's rule (#843): only when the
|
|
* unified views will hold more than the open account's own folders.
|
|
*
|
|
* - Cross-account on and a second account signed in: every account's mail.
|
|
* - Group inboxes merged in and the account has one: own plus group mail.
|
|
*
|
|
* A second account alone is not enough: with cross-account off the views
|
|
* cover only the active account, so "All inboxes" merely repeated Inbox.
|
|
*/
|
|
export function showUnifiedSection(opts: {
|
|
accountCount: number;
|
|
unifiedCrossAccount: boolean;
|
|
includeGroupInUnified: boolean;
|
|
hasSharedInbox: boolean;
|
|
}): boolean {
|
|
const crossAccountActive = opts.unifiedCrossAccount && opts.accountCount > 1;
|
|
return crossAccountActive || (opts.includeGroupInUnified && opts.hasSharedInbox);
|
|
}
|