jsgar 3.7.1 → 3.7.2
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/dist/gar.umd.js +12 -4
- package/package.json +1 -1
package/dist/gar.umd.js
CHANGED
|
@@ -1075,6 +1075,17 @@
|
|
|
1075
1075
|
this.sendMessage(msg);
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
1078
|
+
/**
|
|
1079
|
+
* Delete a key by name if it exists in the localKeyMap. Safe to call multiple times.
|
|
1080
|
+
* @param {string} keyName - Key name
|
|
1081
|
+
*/
|
|
1082
|
+
deleteKey(keyName) {
|
|
1083
|
+
const keyId = this.localKeyMap.get(keyName);
|
|
1084
|
+
if (keyId) {
|
|
1085
|
+
this.publishDeleteKey(keyId);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1078
1089
|
/**
|
|
1079
1090
|
* Publish a DeleteRecord message using local key and topic IDs.
|
|
1080
1091
|
* @param {number} keyId - Key ID
|
|
@@ -1199,10 +1210,7 @@
|
|
|
1199
1210
|
const resultContainer = { };
|
|
1200
1211
|
|
|
1201
1212
|
const cleanup = () => {
|
|
1202
|
-
|
|
1203
|
-
if (keyId) {
|
|
1204
|
-
this.publishDeleteKey(keyId);
|
|
1205
|
-
}
|
|
1213
|
+
this.deleteKey(queryKey);
|
|
1206
1214
|
};
|
|
1207
1215
|
|
|
1208
1216
|
return new Promise((resolve) => {
|