Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 4e7b52e

Browse filesBrowse files
committed
Update components-api
1 parent 207f0bd commit 4e7b52e
Copy full SHA for 4e7b52e

File tree

Expand file treeCollapse file tree

3 files changed

+17
-13
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+17
-13
lines changed
Open diff view settings
Collapse file

‎dist/dist.js‎

Copy file name to clipboardExpand all lines: dist/dist.js
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10023,7 +10023,6 @@ var ComponentManager = function () {
1002310023
// presave block allows client to gain the benefit of performing something in the debounce cycle.
1002410024
presave && presave();
1002510025

10026-
var mappedUuids = [];
1002710026
var mappedItems = [];
1002810027
var _iteratorNormalCompletion2 = true;
1002910028
var _didIteratorError2 = false;
@@ -10033,12 +10032,6 @@ var ComponentManager = function () {
1003310032
for (var _iterator2 = itemsToSave[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1003410033
var item = _step2.value;
1003510034

10036-
// To prevent duplicates
10037-
if (mappedUuids.includes(item.uuid)) {
10038-
continue;
10039-
}
10040-
10041-
mappedUuids.push(item.uuid);
1004210035
item.updated_at = new Date();
1004310036
mappedItems.push(_this3.jsonObjectForItem(item));
1004410037
}
@@ -10082,6 +10075,17 @@ var ComponentManager = function () {
1008210075
clearTimeout(this.pendingSave);
1008310076
}
1008410077

10078+
var incomingIds = items.map(function (item) {
10079+
return item.uuid;
10080+
});
10081+
10082+
// Replace any existing save items with incoming values
10083+
// Only keep items here who are not in incomingIds
10084+
this.pendingSaveItems = this.pendingSaveItems.filter(function (item) {
10085+
return !incomingIds.includes(item.uuid);
10086+
});
10087+
10088+
// Add new items, now that we've made sure it's cleared of incoming items.
1008510089
this.pendingSaveItems = this.pendingSaveItems.concat(items);
1008610090
this.pendingSave = setTimeout(function () {
1008710091
saveBlock(_this3.pendingSaveItems);
Collapse file

‎package-lock.json‎

Copy file name to clipboardExpand all lines: package-lock.json
+4-4Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "sn-code-editor",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "",
55
"main": "dist/dist.js",
66
"author": "Standard Notes <hello@standardnotes.org>",
77
"dependencies": {},
88
"devDependencies": {
99
"codemirror": "^5.31.0",
10-
"sn-components-api": "1.2.5",
10+
"sn-components-api": "1.2.6",
1111
"babel-cli": "^6.18.0",
1212
"babel-preset-env": "^1.1.1",
1313
"babel-preset-es2015": "^6.24.1",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.