@haex-space/vault-sdk 4.7.0 → 4.7.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/react.mjs CHANGED
@@ -3089,6 +3089,11 @@ var PermissionWaiterRegistry = class {
3089
3089
  for (const callback of [...set]) callback(decision);
3090
3090
  }
3091
3091
  };
3092
+ function promptedKey(error) {
3093
+ const details = error.details ?? {};
3094
+ const field = (name) => typeof details[name] === "string" ? details[name] : error[name];
3095
+ return permissionKey(field("resourceType"), field("action"), field("target"));
3096
+ }
3092
3097
  function toDeniedError(error) {
3093
3098
  return { ...error, code: 1002 /* DENIED */ };
3094
3099
  }
@@ -3101,7 +3106,7 @@ async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_D
3101
3106
  if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
3102
3107
  throw error;
3103
3108
  }
3104
- const key = permissionKey(error.resourceType, error.action, error.target);
3109
+ const key = promptedKey(error);
3105
3110
  const times = asked.get(key) ?? 0;
3106
3111
  if (times >= MAX_PERMISSION_RETRIES) throw error;
3107
3112
  asked.set(key, times + 1);