@dubsdotapp/expo 0.4.0 → 0.4.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
@@ -2856,6 +2856,8 @@ function useArcadeBridge({
2856
2856
  const webviewRef = (0, import_react22.useRef)(null);
2857
2857
  const sessionTokenRef = (0, import_react22.useRef)(null);
2858
2858
  const gameStartTimeRef = (0, import_react22.useRef)(0);
2859
+ const canPlayRef = (0, import_react22.useRef)(canPlay);
2860
+ canPlayRef.current = canPlay;
2859
2861
  const [lastResult, setLastResult] = (0, import_react22.useState)(null);
2860
2862
  const [bridgeLoading, setBridgeLoading] = (0, import_react22.useState)(false);
2861
2863
  const injectSession = (0, import_react22.useCallback)((token, attemptNumber) => {
@@ -2894,7 +2896,7 @@ function useArcadeBridge({
2894
2896
  if (data.dubsArcade !== PROTOCOL_VERSION) return;
2895
2897
  switch (data.type) {
2896
2898
  case "TAP_PLAY": {
2897
- if (canPlay) {
2899
+ if (canPlayRef.current) {
2898
2900
  triggerPlay();
2899
2901
  }
2900
2902
  return;
@@ -2923,7 +2925,7 @@ function useArcadeBridge({
2923
2925
  return;
2924
2926
  }
2925
2927
  },
2926
- [canPlay, triggerPlay, submitScore, onScoreSubmitted, onError]
2928
+ [triggerPlay, submitScore, onScoreSubmitted, onError]
2927
2929
  );
2928
2930
  return { webviewRef, handleMessage, triggerPlay, lastResult, bridgeLoading };
2929
2931
  }