@empoweredvote/ev-ui 0.6.0 → 0.6.1

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/index.js CHANGED
@@ -2888,13 +2888,14 @@ function onMessage(event) {
2888
2888
  if (!data || typeof data !== "object") return;
2889
2889
  if (data.type === "ev-context:value" || data.type === "ev-context:ack") {
2890
2890
  const id = data.requestId;
2891
- if (id && pendingRequests.has(id)) {
2891
+ const wasPending = id && pendingRequests.has(id);
2892
+ if (wasPending) {
2892
2893
  const { resolve, timeout } = pendingRequests.get(id);
2893
2894
  clearTimeout(timeout);
2894
2895
  pendingRequests.delete(id);
2895
2896
  resolve(data.type === "ev-context:value" ? (_a = data.value) != null ? _a : null : data.ok);
2896
2897
  }
2897
- if (data.type === "ev-context:value") {
2898
+ if (data.type === "ev-context:value" && !wasPending) {
2898
2899
  lastValue = (_b = data.value) != null ? _b : null;
2899
2900
  notifySubscribers();
2900
2901
  }