nodebb-plugin-composer-default 10.0.23 → 10.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.0.23",
3
+ "version": "10.0.24",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -5,7 +5,14 @@ define('composer/drafts', ['api', 'alerts'], function (api, alerts) {
5
5
  const draftSaveDelay = 1000;
6
6
  drafts.init = function (postContainer, postData) {
7
7
  const draftIconEl = postContainer.find('.draft-icon');
8
+ const uuid = postContainer.attr('data-uuid');
8
9
  function doSaveDraft() {
10
+ // check if composer is still around,
11
+ // it might have been gone by the time this timeout triggers
12
+ if (!$(`[component="composer"][data-uuid="${uuid}"]`).length) {
13
+ return;
14
+ }
15
+
9
16
  if (!postData.save_id) {
10
17
  postData.save_id = utils.generateSaveId(app.user.uid);
11
18
  }