Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
f9d91c3
wip: Ui improvemnts
martgil Jun 6, 2024
1b36406
wip: Enable fullscreen mode on compose startup
martgil Jun 6, 2024
1543840
wip: Add currentPage http parameters when opening Settings page (for …
martgil Jun 6, 2024
a7e6915
wip: Add Thunderbird API type definitions
martgil Jun 6, 2024
89dae30
wip
martgil Jun 7, 2024
d977395
wip
martgil Jun 7, 2024
9b0df56
wip
martgil Jun 7, 2024
dec8f09
Pr review: apply simplification
martgil Jun 8, 2024
f1c1ebd
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jun 11, 2024
de39851
Pr review: use rawPageUrlParams
martgil Jun 11, 2024
41dea50
wip: Fix failing test
martgil Jun 11, 2024
60bc5cd
wip: Handles thunderbird popup from the background script
martgil Jun 12, 2024
1576906
wip: transfer recipient details for email reply
martgil Jun 12, 2024
1413e14
wip: Add a way to parse rendered recipients
martgil Jun 12, 2024
b286543
wip: Properly handled closing of Thunderbird compose window
martgil Jun 13, 2024
0d8349f
PR review: cleanup
martgil Jun 17, 2024
a63e79c
Pr review: Add "secure compose" on messageDisplay
martgil Jun 17, 2024
5fa4782
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 19, 2024
7db7a30
Pr review: Define type for the Thunderbird message details
martgil Jun 19, 2024
0ce90c2
Fix: email duplicates and unexpected creation of drafts upon recipien…
martgil Jun 19, 2024
a1a812c
wip: refactor + cleanup
martgil Jun 19, 2024
e55c470
Fix: slow rendering of secure compose in full screen
martgil Jun 19, 2024
67fddc9
wip: fix failing test
martgil Jun 20, 2024
d34a28a
Fix: unexpected draft creation during secure compose prefill
martgil Jun 20, 2024
478f864
wip: Render quoted plain text email when possible
martgil Jun 20, 2024
c66c4d7
wip: Apply UI improvement and fixes
martgil Jun 20, 2024
51c608e
wip: Fix failing tests
martgil Jun 20, 2024
5dbb65e
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 20, 2024
d4fedab
wip: Revert unnecesary changes made by prettier extension
martgil Jun 20, 2024
5e92f9c
wip: Revert unnecesary changes made by prettier extension
martgil Jun 21, 2024
fa9da7f
wip: Revert unintended changes
martgil Jun 21, 2024
3a82858
cleanup
martgil Jun 21, 2024
38b6808
wip: remove service_worker in Thunderbird manifest.json
martgil Jun 21, 2024
21f9c98
wip
martgil Jun 21, 2024
20eea32
wip: Enable quoted email rendering for multiple account
martgil Jun 21, 2024
1f968a4
cleanup: Remove unncessary code since secure compose is now straight …
martgil Jun 21, 2024
f80a0d8
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 22, 2024
676802a
Pr review: redirecting from messageDisplay include email rendering if…
martgil Jun 22, 2024
4b72776
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jun 24, 2024
0b16521
wip: refactor
martgil Jun 25, 2024
10865da
wip: refactor
martgil Jun 25, 2024
e950d73
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 25, 2024
c9b148d
wip: refactor
martgil Jun 26, 2024
579d45b
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 26, 2024
8f071d2
wip: refine Gmail.threadIdGet
martgil Jun 26, 2024
14f17fc
wip: better quote email rendering and recognizing reply and forward r…
martgil Jun 26, 2024
39dd5a5
Merge remote-tracking branch 'origin/master' into issue-5666-add-comp…
martgil Jun 27, 2024
d0dd04e
Pr review: remove eslint exception flags
martgil Jun 28, 2024
71be459
Pr review: destructure getFull() return values
martgil Jun 28, 2024
20da493
Pr review: Set a better place to run parseThreadIdFromHeaderMessageId()
martgil Jun 28, 2024
f7b4da3
Pr review: cleanup
martgil Jun 28, 2024
908b47c
Pr review: Remove unused css
martgil Jun 28, 2024
c5996ab
Pr review: Remove Gmail re-iniatialization
martgil Jun 28, 2024
cb0a31e
Pr review: use already exist Gmail functions and typings for email se…
martgil Jun 28, 2024
f07a058
wip: cleanup
martgil Jun 28, 2024
f4826cb
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jun 28, 2024
0dd777a
wip: cleanup
martgil Jun 28, 2024
3c5e2d3
wip: cleanup
martgil Jun 28, 2024
e866250
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jun 29, 2024
f27ad67
wip: improvement
martgil Jun 29, 2024
ad9c8ba
wip: long blockquote fix thunderbird
martgil Jun 29, 2024
9b5e521
wip: sanitize html body if plain text body not found
martgil Jun 29, 2024
48c89cd
wip: ensure messageToReplyOrForward.headers.from is not in "mailbox" …
martgil Jun 29, 2024
e09bfef
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 3, 2024
53de3d1
Pr review: minor fixes
martgil Jul 3, 2024
bf2d9ff
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 8, 2024
fa17dc6
Pr review: fix secure compose not opening for new message
martgil Jul 8, 2024
a880280
Pr review: fix secure compose not appearing
martgil Jul 8, 2024
3242bab
wip: add detection for HTML only MIME email
martgil Jul 8, 2024
6bf7f53
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 10, 2024
76f6593
Pr review: reuse compose.replyOption
martgil Jul 10, 2024
93467cc
Pr review: fix recipient pre-filled data for non-forwarded reply
martgil Jul 10, 2024
89fe62e
Pr review: use better namespace for Thunderbird API typings
martgil Jul 10, 2024
ddeabce
Add support to replying on current threadId (Thunderbird)
martgil Jul 14, 2024
18595b3
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 17, 2024
763dda4
Improve UX for Thunderbird client users
martgil Jul 17, 2024
964df72
Remove already performed function
martgil Jul 18, 2024
37e243c
Revert changes on compose-render-module.ts
martgil Jul 18, 2024
320620b
Fix discrepancy between replyMsgId and isReplyBox usage
martgil Jul 18, 2024
415f126
Refactor close_compose_window, fixing the event handler that was not …
martgil Jul 18, 2024
8a9bd6c
Fix passphrase_dialog not appearing
martgil Jul 18, 2024
4ee981c
Use appropriate detection for Time.sleep()
martgil Jul 18, 2024
2275b39
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 19, 2024
4825733
Merge branch 'master' into issue-5666-add-compose-button-on-thunderbird
martgil Jul 22, 2024
cf63c3e
Add better check and comment for UI bug fix
martgil Jul 23, 2024
8b5f8d8
Fix popoverItems undefined when using FullScreen secure compose
martgil Jul 23, 2024
9806c94
Revert changes
martgil Jul 23, 2024
35a07cf
Fix duplicate ComposeBox initialization for non-reply email (new secu…
martgil Jul 23, 2024
a3210e5
Add back CSS UI fixes
martgil Jul 23, 2024
4e58b0e
Fix quoted email for email to follow forwarded email format
martgil Jul 23, 2024
794659a
wip: cleanup
martgil Jul 23, 2024
3a61d4c
Revert changes
martgil Jul 23, 2024
bd6a950
Revert changes
martgil Jul 23, 2024
aa3344d
cleanup
martgil Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ViewModule } from '../../../js/common/view-module.js';
import { ComposeView } from '../compose.js';
import { MessageToReplyOrForward } from './compose-types.js';
import { KeyStore } from '../../../js/common/platform/store/key-store.js';
import { Time } from '../../../js/common/browser/time.js';

export class ComposeQuoteModule extends ViewModule<ComposeView> {
public tripleDotSanitizedHtmlContent: { quote: string | undefined; footer: string | undefined } | undefined;
Expand Down Expand Up @@ -177,6 +178,9 @@ export class ComposeQuoteModule extends ViewModule<ComposeView> {
if (decryptRes.success) {
return decryptRes.content.toUtfStr();
} else if (decryptRes.error && decryptRes.error.type === DecryptErrTypes.needPassphrase) {
if (Catch.isThunderbirdMail() && this.view.useFullScreenSecureCompose) {
await Time.sleep(2300);
}
BrowserMsg.send.passphraseDialog(this.view.parentTabId, {
type: 'quote',
longids: decryptRes.longids.needPassphrase,
Expand Down Expand Up @@ -206,7 +210,7 @@ export class ComposeQuoteModule extends ViewModule<ComposeView> {
return;
}
const text = this.messageToReplyOrForward.text;
const from = this.messageToReplyOrForward.headers.from;
const from = Str.parseEmail(this.messageToReplyOrForward.headers.from || '').email;
const date = new Date(String(this.messageToReplyOrForward.headers.date));
const dateStr = Str.fromDate(date).replace(' ', ' at ');
const rtl = text.match(new RegExp('[' + Str.rtlChars + ']'));
Expand All @@ -215,7 +219,8 @@ export class ComposeQuoteModule extends ViewModule<ComposeView> {
if (method === 'reply') {
const header = `<div ${dirAttr}>On ${dateStr}, ${from ?? ''} wrote:</div>`;
const sanitizedQuote = Xss.htmlSanitize(header + escapedText);
return `<blockquote ${dirAttr}>${sanitizedQuote}</blockquote>`;
const thunderbirdClass = this.view.useFullScreenSecureCompose ? 'class="height-0"' : ''; // fix long quoted email UI issue happens in fullscreen
return `<blockquote ${thunderbirdClass} ${dirAttr}>${sanitizedQuote}</blockquote>`;
} else {
const header =
`<div ${dirAttr}>` +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
private previousReplyOption: ReplyOption | undefined;

public initComposeBox = async () => {
if (this.view.isReplyBox) {
if (this.view.useFullScreenSecureCompose) {
this.view.S.cached('body').addClass('full_window');
this.view.S.cached('password_or_pubkey').height(1); // fix UI issue in fullscreen
}
if (this.view.replyMsgId) {
this.responseMethod = 'reply';
}
await this.view.replyPopoverModule.render(this.view.isReplyBox);
Expand All @@ -41,11 +45,11 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
this.view.draftModule.startDraftTimer();
this.view.S.cached('triple_dot').remove(); // if it's draft, footer and quote should already be included in the draft
}
if (this.view.isReplyBox) {
if (this.view.replyMsgId) {
await this.view.renderModule.renderReplyMsgComposeTable();
}
} else {
if (this.view.isReplyBox && this.view.replyParams) {
if (this.view.replyMsgId && this.view.replyParams) {
const recipients: Recipients = {
to: this.view.replyParams.to,
cc: this.view.replyParams.cc,
Expand Down Expand Up @@ -99,6 +103,9 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
)?.value;
}
this.view.replyParams.subject = `${this.responseMethod === 'reply' ? 'Re' : 'Fwd'}: ${this.view.replyParams.subject}`;
if (this.view.useFullScreenSecureCompose) {
this.view.S.cached('input_subject').val(this.view.replyParams.subject);
}
}
if (!this.view.draftModule.wasMsgLoadedFromDraft) {
// if there is a draft, don't attempt to pull quoted content. It's assumed to be already present in the draft
Expand Down Expand Up @@ -260,6 +267,12 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
await this.renderReplyMsgComposeTable();
};

public actionCloseHandler = async () => {
if (!this.view.sendBtnModule.isSendMessageInProgres() || (await Ui.modal.confirm(Lang.compose.abortSending))) {
this.view.renderModule.closeMsg();
}
};

private initComposeBoxStyles = () => {
if (this.view.isReplyBox) {
this.view.S.cached('body').addClass('reply_box');
Expand Down Expand Up @@ -328,16 +341,12 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
this.view.S.cached('compose_table').css('display', 'table');
await this.addComposeTableHandlers();
await this.view.senderModule.renderSendFromIfMoreThanOneAlias();
if (this.view.isReplyBox) {
if (this.view.replyMsgId) {
if (this.view.replyParams?.to.length) {
// Firefox will not always respond to initial automatic $input_text.blur(): recipients may be left unrendered, as standard text, with a trailing comma
await this.view.recipientsModule.parseRenderRecipients(this.view.S.cached('input_to')); // this will force firefox to render them on load
}
} else {
$('.close_compose_window').on(
'click',
this.view.setHandler(() => this.actionCloseHandler(), this.view.errModule.handle(`close compose window`))
);
this.view.S.cached('title').on('click', () => {
if (this.view.sizeModule.composeWindowIsMinimized) {
$('.minimize_compose_window').trigger('click');
Expand Down Expand Up @@ -400,12 +409,6 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
}
};

private actionCloseHandler = async () => {
if (!this.view.sendBtnModule.isSendMessageInProgres() || (await Ui.modal.confirm(Lang.compose.abortSending))) {
this.view.renderModule.closeMsg();
}
};

private onRecipientsClickHandler = () => {
if (!this.view.S.cached('input_to').is(':focus')) {
this.view.errModule.debug(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export class ComposeReplyBtnPopoverModule extends ViewModule<ComposeView> {
};

public changeOptionImage = (option: ReplyOption) => {
$('.reply-options-icon').attr('src', this.popoverItems[option].iconPath);
if (!this.view.useFullScreenSecureCompose) {
$('.reply-options-icon').attr('src', this.popoverItems[option].iconPath);
}
};

private didOptionClick = async (option: ReplyOption) => {
Expand Down
12 changes: 10 additions & 2 deletions extension/chrome/elements/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class ComposeView extends View {
public readonly removeAfterClose: boolean;
public readonly disableDraftSaving: boolean;
public readonly debug: boolean;
public readonly useFullScreenSecureCompose: boolean;
public readonly isReplyBox: boolean;
public readonly replyMsgId: string;
public readonly replyPubkeyMismatch: boolean;
Expand Down Expand Up @@ -108,6 +109,7 @@ export class ComposeView extends View {
toggle_send_options: '#toggle_send_options',
toggle_reply_options: '#toggle_reply_options',
icon_pubkey: '.icon.action_include_pubkey',
close_compose_window: '.close_compose_window',
icon_help: '.action_feedback',
icon_popout: '.popout img',
triple_dot: '.action_show_prev_msg',
Expand Down Expand Up @@ -148,6 +150,7 @@ export class ComposeView extends View {
'removeAfterClose',
'replyPubkeyMismatch',
'replyOption',
'useFullScreenSecureCompose',
]);
this.acctEmail = Assert.urlParamRequire.string(uncheckedUrlParams, 'acctEmail');
this.parentTabId = Assert.urlParamRequire.string(uncheckedUrlParams, 'parentTabId');
Expand All @@ -161,7 +164,8 @@ export class ComposeView extends View {
this.replyPubkeyMismatch = uncheckedUrlParams.replyPubkeyMismatch === true;
this.draftId = Assert.urlParamRequire.optionalString(uncheckedUrlParams, 'draftId') || '';
this.replyMsgId = Assert.urlParamRequire.optionalString(uncheckedUrlParams, 'replyMsgId') || '';
this.isReplyBox = !!this.replyMsgId;
this.useFullScreenSecureCompose = uncheckedUrlParams.useFullScreenSecureCompose === true;
this.isReplyBox = !!this.replyMsgId && !this.useFullScreenSecureCompose;
this.emailProvider = new Gmail(this.acctEmail);
this.acctServer = new AccountServer(this.acctEmail);
}
Expand Down Expand Up @@ -201,7 +205,7 @@ export class ComposeView extends View {
}
BrowserMsg.listen(this.tabId);
await this.renderModule.initComposeBox();
if (this.replyOption && this.isReplyBox) {
if (this.replyOption && this.replyMsgId) {
await this.renderModule.activateReplyOption(this.replyOption, true);
}
this.senderModule.checkEmailAliases().catch(Catch.reportErr);
Expand All @@ -225,6 +229,10 @@ export class ComposeView extends View {
});
this.S.cached('body').on('focusin', setActiveWindow);
this.S.cached('body').on('click', setActiveWindow);
this.S.cached('close_compose_window').on(
'click',
this.setHandler(async () => await this.renderModule.actionCloseHandler(), this.errModule.handle(`close compose window`))
);
this.S.cached('icon_help').on(
'click',
this.setHandler(async () => await this.renderModule.openSettingsWithDialog('help'), this.errModule.handle(`help dialog`))
Expand Down
6 changes: 4 additions & 2 deletions extension/chrome/settings/inbox/inbox.htm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

<body id="settings" class="client">
<div class="line header" id="banner">
This page has limited functionality. Using FlowCrypt directly in Gmail is more convenient:
<a href="https://mail.google.com/" class="action_open_webmail">Open Gmail</a>
<div id="container-gmail-banner">
This page has limited functionality. Using FlowCrypt directly in Gmail is more convenient:
<a href="https://mail.google.com/" class="action_open_webmail">Open Gmail</a>
</div>

<img src="/img/svgs/profile-icon.svg" class="action_choose_account action-toggle-accounts-menu profile-img main-profile-img" alt="Profile Image" />
<img src="/img/svgs/settings-icon.svg" class="action_open_settings" alt="Settings" title="Open FlowCrypt Settings" />
Expand Down
53 changes: 51 additions & 2 deletions extension/chrome/settings/inbox/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export class InboxView extends View {
public readonly threadId: string | undefined;
public readonly showOriginal: boolean;
public readonly debug: boolean;
public readonly useFullScreenSecureCompose: boolean;
public readonly thunderbirdMsgId: number | undefined;
public readonly composeMethod: 'reply' | 'forward' | undefined;
public readonly S: SelCache;
public readonly gmail: Gmail;

Expand All @@ -49,12 +52,24 @@ export class InboxView extends View {

public constructor() {
super();
const uncheckedUrlParams = Url.parse(['acctEmail', 'labelId', 'threadId', 'showOriginal', 'debug']);
const uncheckedUrlParams = Url.parse([
'acctEmail',
'labelId',
'threadId',
'showOriginal',
'debug',
'useFullScreenSecureCompose',
'composeMethod',
'thunderbirdMsgId',
]);
this.acctEmail = Assert.urlParamRequire.string(uncheckedUrlParams, 'acctEmail');
this.labelId = uncheckedUrlParams.labelId ? String(uncheckedUrlParams.labelId) : 'INBOX';
this.threadId = Assert.urlParamRequire.optionalString(uncheckedUrlParams, 'threadId');
this.showOriginal = uncheckedUrlParams.showOriginal === true;
this.debug = uncheckedUrlParams.debug === true;
this.useFullScreenSecureCompose = uncheckedUrlParams.useFullScreenSecureCompose === true;
this.composeMethod = (Assert.urlParamRequire.optionalString(uncheckedUrlParams, 'composeMethod') as 'reply') || 'forward';
this.thunderbirdMsgId = Number(Assert.urlParamRequire.optionalString(uncheckedUrlParams, 'thunderbirdMsgId'));
this.S = Ui.buildJquerySels({ threads: '.threads', thread: '.thread', body: 'body' });
this.gmail = new Gmail(this.acctEmail);
this.inboxMenuModule = new InboxMenuModule(this);
Expand All @@ -72,6 +87,11 @@ export class InboxView extends View {
({ email_provider: emailProvider, picture: this.picture } = await AcctStore.get(this.acctEmail, ['email_provider', 'picture']));
this.messageRenderer = await MessageRenderer.newInstance(this.acctEmail, this.gmail, this.relayManager, this.factory, this.debug);
this.inboxNotificationModule.render();
const parsedThreadId = await this.parseThreadIdFromHeaderMessageId();
this.preRenderSecureComposeInFullScreen(parsedThreadId);
if (Catch.isThunderbirdMail()) {
$('#container-gmail-banner').hide();
}
try {
await Settings.populateAccountsMenu('inbox.htm');
if (emailProvider && emailProvider !== 'gmail') {
Expand All @@ -81,7 +101,11 @@ export class InboxView extends View {
if (this.threadId) {
await this.inboxActiveThreadModule.render(this.threadId);
} else {
await this.inboxListThreadsModule.render(this.labelId);
if (parsedThreadId && !this.useFullScreenSecureCompose) {
await this.inboxActiveThreadModule.render(parsedThreadId);
} else {
await this.inboxListThreadsModule.render(this.labelId);
}
}
}
} catch (e) {
Expand Down Expand Up @@ -133,6 +157,31 @@ export class InboxView extends View {
Xss.sanitizeRender('h1', title);
};

private preRenderSecureComposeInFullScreen = (replyMsgId?: string) => {
if (this.useFullScreenSecureCompose && this.composeMethod) {
const replyOption = this.composeMethod === 'reply' ? 'a_reply' : 'a_forward';
this.injector.openComposeWin(undefined, true, this.thunderbirdMsgId, replyOption, replyMsgId);
}
};

private parseThreadIdFromHeaderMessageId = async () => {
let threadId;
if (Catch.isThunderbirdMail() && this.thunderbirdMsgId) {
const { headers } = await messenger.messages.getFull(this.thunderbirdMsgId);
if (headers) {
const messageId = headers['message-id'][0];
if (messageId) {
const query = `rfc822msgid:${messageId}`;
const gmailRes = await this.gmail.msgList(query);
if (gmailRes.messages) {
threadId = gmailRes.messages[0].threadId;
}
}
}
}
return threadId;
};

private addBrowserMsgListeners = () => {
BrowserMsg.addListener('add_end_session_btn', () => this.injector.insertEndSessionBtn(this.acctEmail));
BrowserMsg.addListener('set_active_window', async ({ frameId }: Bm.ComposeWindow) => {
Expand Down
1 change: 1 addition & 0 deletions extension/chrome/settings/initial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ View.run(
const browserName = Catch.browser().name === 'chrome' && Number(Catch.browser().v) >= 76 ? 'chrome' : Catch.browser().name;
if (browserName === 'thunderbird') {
$('#img-setup-arrow').hide();
$('#thunderbird-steps').parent().parent().css('text-align', 'center');
}
const stepsEl = document.getElementById(`${browserName}-steps`);
if (stepsEl) {
Expand Down
2 changes: 1 addition & 1 deletion extension/chrome/settings/setup.htm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h1>Set Up FlowCrypt</h1>

<div id="step_4_done">
<div class="wide line">
<a class="button longer green action_send" target="_blank">COMPOSE ENCRYPTED EMAIL</a>
<a class="button longer green action_send">COMPOSE ENCRYPTED EMAIL</a>
</div>
<div class="wide line">
<button class="button longer gray action_account_settings" data-test="action-step4done-account-settings">MORE SETTINGS</button>
Expand Down
12 changes: 11 additions & 1 deletion extension/chrome/settings/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Swal from 'sweetalert2';
import { BackupUi } from '../../js/common/ui/backup-ui/backup-ui.js';
import { InMemoryStoreKeys } from '../../js/common/core/const.js';
import { InMemoryStore } from '../../js/common/platform/store/in-memory-store.js';
import { BgUtils } from '../../js/service_worker/bgutils.js';

/* eslint-disable @typescript-eslint/naming-convention */
export interface PassphraseOptions {
Expand Down Expand Up @@ -167,7 +168,10 @@ export class SetupView extends View {
await Ui.modal.info(notification);
});
BrowserMsg.listen(this.tabId);
$('.action_send').attr('href', Google.webmailUrl(this.acctEmail));
$('.action_send').on(
'click',
this.setHandler(async () => await this.actionComposeEncryptedEmailHandler())
);
$('.action_show_help').on(
'click',
this.setHandler(async () => await Settings.renderSubPage(this.acctEmail, this.tabId, '/chrome/settings/modules/help.htm'))
Expand Down Expand Up @@ -375,6 +379,12 @@ export class SetupView extends View {
return true;
};

private actionComposeEncryptedEmailHandler = async () => {
const inboxUrl = Url.create('/chrome/settings/inbox/inbox.htm', { acctEmail: this.acctEmail });
const redirectUrl = Catch.isThunderbirdMail() ? inboxUrl : Google.webmailUrl(this.acctEmail);
await BgUtils.openExtensionTab(redirectUrl, true);
};

/**
* empty pubkey means key not usable
*/
Expand Down
4 changes: 4 additions & 0 deletions extension/css/cryptup.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* © 2016-2018 FlowCrypt Limited. Limitations apply. Contact human@flowcrypt.com */
.height-0 {
height: 0 !important;
}

.flex {
display: flex;
}
Expand Down
Loading