@parafin/react 7.1.1 → 7.1.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.
Files changed (2) hide show
  1. package/out/index.js +3 -1
  2. package/package.json +2 -2
package/out/index.js CHANGED
@@ -135,6 +135,7 @@ const emptyMetadata = {
135
135
  };
136
136
  const initializeParafinWidget = (iframe, props) => {
137
137
  let initStartTime = Date.now();
138
+ let hasLoadedOnce = false;
138
139
  // @ts-ignore
139
140
  const url = new URL(props.widgetUrlOverride ?? 'https://widget.parafin.com');
140
141
  const query = {
@@ -214,10 +215,11 @@ const initializeParafinWidget = (iframe, props) => {
214
215
  }
215
216
  break;
216
217
  case 'widget-load-complete':
217
- if (props.onEvent) {
218
+ if (props.onEvent && !hasLoadedOnce) {
218
219
  const timeToLoadInMs = Date.now() - initStartTime;
219
220
  props.onEvent('widget_loaded', { timeToLoadInMs });
220
221
  }
222
+ hasLoadedOnce = true;
221
223
  break;
222
224
  }
223
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parafin/react",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "description": "Parafin React widget",
5
5
  "author": "Parafin (https://www.parafin.com)",
6
6
  "module": "out/index.js",
@@ -26,6 +26,6 @@
26
26
  "typescript": "^4.9.5"
27
27
  },
28
28
  "dependencies": {
29
- "@parafin/core": "^3.1.1"
29
+ "@parafin/core": "^3.1.2"
30
30
  }
31
31
  }