summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-07-08 18:22:40 +0200
committerAleksander Machniak <alec@alec.pl>2014-07-08 18:28:38 +0200
commit8437d76389773571ba61d1a50cecba6b72d701c6 (patch)
tree46d25a4c686f3e253617c4c517c6b4cb23ecaec6
parent118a170dbca9f55badb3f05abb231c1c98eb3539 (diff)
Fix bug where compose storage wasn't cleared on page unload (#1489818)
-rw-r--r--CHANGELOG1
-rw-r--r--program/js/app.js8
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 7553b68d6..af925da7c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -22,6 +22,7 @@ CHANGELOG Roundcube Webmail
- Fix Delete button state after deleting identity/response (#1489972)
- Fix bug where contacts with no email address were listed on compose addressbook (#1489970)
- Fix images import from various vCard formats (#1489977)
+- Fix bug where compose storage wasn't cleared on page unload (#1489818)
RELEASE 1.0.1
-------------
diff --git a/program/js/app.js b/program/js/app.js
index 25f7b1eee..aa781f557 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -590,9 +590,6 @@ function rcube_webmail()
if (this.task == 'mail' && this.env.action == 'compose' && $.inArray(command, this.env.compose_commands) < 0 && !this.env.server_error) {
if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
return false;
-
- // remove copy from local storage if compose screen is left intentionally
- this.remove_compose_data(this.env.compose_id);
}
// process external commands
@@ -3679,6 +3676,11 @@ function rcube_webmail()
ref.compose_type_activity_last = ref.compose_type_activity;
}
}, 5000);
+
+ // remove data from local storage if compose screen is left
+ $(window).unload(function() {
+ ref.remove_compose_data(ref.env.compose_id);
+ });
}
// Unlock interface now that saving is complete