Skip to content

Commit 5d7f052

Browse files
committed
revert previous changes
1 parent 5c843f7 commit 5d7f052

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

extension/js/content_scripts/webmail/generic/webmail-element-replacer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export abstract class WebmailElementReplacer {
99
private replacePgpElsInterval: number;
1010

1111
public abstract getIntervalFunctions: () => IntervalFunction[];
12-
public abstract setReplyBoxEditable: (messageContainer?: JQuery<Element>) => Promise<void>;
12+
public abstract setReplyBoxEditable: () => Promise<void>;
1313
public abstract reinsertReplyBox: (replyMsgId: string) => void;
1414
public abstract scrollToReplyBox: (replyMsgId: string) => void;
1515
public abstract scrollToCursorInReplyBox: (replyMsgId: string, cursorOffsetTop: number) => void;

extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ export class GmailElementReplacer extends WebmailElementReplacer {
8585
];
8686
};
8787

88-
public setReplyBoxEditable = async (messageContainer?: JQuery<Element>) => {
88+
public setReplyBoxEditable = async () => {
8989
const replyContainerIframe = $('.reply_message_iframe_container > iframe').last();
90-
if (replyContainerIframe.length && messageContainer) {
91-
$(replyContainerIframe).replaceWith(this.factory.embeddedReply(this.getLastMsgReplyParams(messageContainer), true)); // xss-safe-value
90+
if (replyContainerIframe.length) {
91+
$(replyContainerIframe).replaceWith(this.factory.embeddedReply(this.getLastMsgReplyParams(this.getConvoRootEl(replyContainerIframe[0])), true)); // xss-safe-value
9292
} else {
9393
await this.replaceStandardReplyBox(undefined, true);
9494
}
@@ -351,10 +351,10 @@ export class GmailElementReplacer extends WebmailElementReplacer {
351351
return;
352352
}
353353
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
354-
const messageContainer: JQuery<Element> = $(btn.closest('.h7')!);
354+
const messageContainer = $(btn.closest('.h7')!);
355355
if (messageContainer.is(':last-child')) {
356356
if (this.isEncrypted()) {
357-
await this.setReplyBoxEditable(messageContainer);
357+
await this.setReplyBoxEditable();
358358
} else {
359359
await this.replaceStandardReplyBox(undefined, true);
360360
}
@@ -589,10 +589,8 @@ export class GmailElementReplacer extends WebmailElementReplacer {
589589
return from ? Str.parseEmail(from) : undefined;
590590
};
591591

592-
private getLastMsgReplyParams = (convoRootEl: JQuery<Element>): FactoryReplyParams => {
593-
const msgIdElement = $(convoRootEl).find('[data-legacy-message-id], [data-message-id]');
594-
const msgId = msgIdElement.attr('data-legacy-message-id') || msgIdElement.attr('data-message-id');
595-
return { replyMsgId: msgId };
592+
private getLastMsgReplyParams = (convoRootEl: JQuery): FactoryReplyParams => {
593+
return { replyMsgId: this.determineMsgId($(convoRootEl).find(this.sel.msgInner).last()) };
596594
};
597595

598596
private getConvoRootEl = (anyInnerElement: HTMLElement) => {

0 commit comments

Comments
 (0)