This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 7e08bf3 Another shared global
7e08bf3 is described below
commit 7e08bf33f904972e71bffde5b91a3fd63792f5b0
Author: Sebb <[email protected]>
AuthorDate: Thu Nov 18 17:32:54 2021 +0000
Another shared global
---
webui/js/source/aavariables.js | 4 ++++
webui/js/source/composer.js | 2 +-
webui/js/source/key-commands.js | 2 +-
webui/js/source/render-email.js | 4 +---
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/webui/js/source/aavariables.js b/webui/js/source/aavariables.js
index db1631f..6708853 100644
--- a/webui/js/source/aavariables.js
+++ b/webui/js/source/aavariables.js
@@ -42,6 +42,10 @@ const PONYMAIL_MAX_NESTING = 10; // max nesting level before
unthreading to save
// thread state
let G_current_email_idx;
let G_chatty_layout = true;
+
+// emails (composer, key-commands, render-email)
+let full_emails = {};
+
const PONYMAIL_DATE_FORMAT = {
weekday: 'long',
year: 'numeric',
diff --git a/webui/js/source/composer.js b/webui/js/source/composer.js
index cc69569..1bcaa47 100644
--- a/webui/js/source/composer.js
+++ b/webui/js/source/composer.js
@@ -25,7 +25,7 @@ function compose_email(replyto, list) {
let email = null;
let mua_trigger = null;
let loggedIn = (G_ponymail_preferences.login &&
G_ponymail_preferences.login.credentials) ? true : false;
- if (replyto) email = full_emails[replyto || ''];
+ if (replyto) email = G_full_emails[replyto || ''];
let listname = list;
mua_headers = {};
if (email) {
diff --git a/webui/js/source/key-commands.js b/webui/js/source/key-commands.js
index a5949c5..2265985 100644
--- a/webui/js/source/key-commands.js
+++ b/webui/js/source/key-commands.js
@@ -160,7 +160,7 @@ function keyCommands(e) {
return;
case 'r':
console.log(G_current_open_email);
- if (G_current_open_email && full_emails[G_current_open_email])
{
+ if (G_current_open_email &&
G_full_emails[G_current_open_email]) {
compose_email(G_current_open_email);
}
return;
diff --git a/webui/js/source/render-email.js b/webui/js/source/render-email.js
index cd46a9b..e547e97 100644
--- a/webui/js/source/render-email.js
+++ b/webui/js/source/render-email.js
@@ -1,5 +1,3 @@
-let full_emails = {};
-
// Function for parsing email addresses from a to or cc line
function get_rcpts(addresses) {
let list_of_emails = []
@@ -19,7 +17,7 @@ function get_rcpts(addresses) {
async function render_email(state, json) {
let div = state.div;
- full_emails[json.mid] = json; // Save for composer if replying later...
+ G_full_emails[json.mid] = json; // Save for composer if replying later...
if (state.scroll) {
let rect = div.getBoundingClientRect();
try {