@onekeyfe/hwk-trezor-adapter 1.2.8-alpha.122 → 1.2.8-alpha.123

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.d.mts CHANGED
@@ -124,8 +124,7 @@ declare class TrezorAdapter implements IHardwareWallet {
124
124
  private _getTrezorDeviceId;
125
125
  cancel(connectId?: string): void;
126
126
  /**
127
- * Operation owning the running job: its queue key when pinned, else the live
128
- * operation of its connectId, so a mid-call UI request can name it.
127
+ * Only the operation explicitly supplied to the running job owns its UI requests.
129
128
  */
130
129
  private _activeOperationId;
131
130
  /**
package/dist/index.d.ts CHANGED
@@ -124,8 +124,7 @@ declare class TrezorAdapter implements IHardwareWallet {
124
124
  private _getTrezorDeviceId;
125
125
  cancel(connectId?: string): void;
126
126
  /**
127
- * Operation owning the running job: its queue key when pinned, else the live
128
- * operation of its connectId, so a mid-call UI request can name it.
127
+ * Only the operation explicitly supplied to the running job owns its UI requests.
129
128
  */
130
129
  private _activeOperationId;
131
130
  /**
package/dist/index.js CHANGED
@@ -913,7 +913,8 @@ var _TrezorAdapter = class _TrezorAdapter {
913
913
  this._emitter.emit(data.type, { ...data, payload });
914
914
  };
915
915
  this._onUiEvent = (data) => {
916
- this._emitter.emit("ui-event", data);
916
+ const operationId = this._activeOperationId();
917
+ this._emitter.emit("ui-event", operationId ? { ...data, operationId } : data);
917
918
  };
918
919
  this._onThpCredentialsChanged = (data) => {
919
920
  this._emitter.emit(_hwkadaptercore.DEVICE.TREZOR_THP_CREDENTIALS_CHANGED, {
@@ -1732,7 +1733,7 @@ var _TrezorAdapter = class _TrezorAdapter {
1732
1733
  for (const key of queueKeys) {
1733
1734
  this._jobQueue.cancelActiveAndPending(key, userAbortReason);
1734
1735
  }
1735
- if (resolvedConnectId) {
1736
+ if (resolvedConnectId && (activeJobId === void 0 || ownsConnectorInteraction)) {
1736
1737
  void this._connector.cancel(_nullishCoalesce(this._sessions.get(resolvedConnectId), () => ( resolvedConnectId)));
1737
1738
  }
1738
1739
  return;
@@ -1745,8 +1746,7 @@ var _TrezorAdapter = class _TrezorAdapter {
1745
1746
  }
1746
1747
  }
1747
1748
  /**
1748
- * Operation owning the running job: its queue key when pinned, else the live
1749
- * operation of its connectId, so a mid-call UI request can name it.
1749
+ * Only the operation explicitly supplied to the running job owns its UI requests.
1750
1750
  */
1751
1751
  _activeOperationId() {
1752
1752
  return this._operations.findOperationIdByJobKey(_optionalChain([this, 'access', _76 => _76._jobQueue, 'access', _77 => _77.getActiveJob, 'call', _78 => _78(), 'optionalAccess', _79 => _79.deviceId]));