@rango-dev/widget-embedded 0.1.10-next.96 → 0.1.10-next.98

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.
@@ -15,10 +15,10 @@ import { styled as styled$1 } from '@rango-dev/ui/src/theme';
15
15
  import { allProviders } from '@rango-dev/provider-all';
16
16
  import { useManager, Provider } from '@rango-dev/queue-manager-react';
17
17
  import copy from 'copy-to-clipboard';
18
+ import { cancelSwap, swapQueueDef } from '@rango-dev/queue-manager-rango-preset';
18
19
  import i18n from 'i18next';
19
20
  import Backend from 'i18next-http-backend';
20
21
  import LanguageDetector from 'i18next-browser-languagedetector';
21
- import { swapQueueDef } from '@rango-dev/queue-manager-rango-preset';
22
22
 
23
23
  const navigationRoutes = {
24
24
  home: '/',
@@ -2329,16 +2329,20 @@ function SwapDetailsPage() {
2329
2329
  swap
2330
2330
  } = _ref;
2331
2331
  return swap.requestId === selectedSwapRequestId;
2332
- })?.swap;
2332
+ });
2333
+ //TODO: implement swap cancellation (move queueManager logic to queueManager/rango-preset)
2334
+ const onCancel = () => {
2335
+ const swap = selectedSwap ? manager?.get(selectedSwap.id) : undefined;
2336
+ if (swap) cancelSwap(swap);
2337
+ };
2333
2338
  return React.createElement(SwapHistory, {
2334
2339
  onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
2335
2340
  //todo: move PendingSwap type to rango-types
2336
2341
  //@ts-ignore
2337
- pendingSwap: selectedSwap,
2342
+ pendingSwap: selectedSwap?.swap,
2338
2343
  onCopy: handleCopy,
2339
2344
  isCopied: isCopied,
2340
- //todo: implement swap cancellation (move queueManager logic to queueManager/rango-preset)
2341
- onCancel: requestId => console.log(requestId)
2345
+ onCancel: onCancel
2342
2346
  });
2343
2347
  }
2344
2348