@rango-dev/widget-embedded 0.1.10-next.95 → 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: '/',
@@ -1971,6 +1971,8 @@ function ConfirmSwapPage() {
1971
1971
  if (swap) {
1972
1972
  manager?.create('swap', {
1973
1973
  swapDetails: swap
1974
+ }, {
1975
+ id: swap.requestId
1974
1976
  });
1975
1977
  setSelectedSwap(swap.requestId);
1976
1978
  navigate(navigationRoutes.swaps + `/${swap.requestId}`, {
@@ -2327,16 +2329,20 @@ function SwapDetailsPage() {
2327
2329
  swap
2328
2330
  } = _ref;
2329
2331
  return swap.requestId === selectedSwapRequestId;
2330
- })?.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
+ };
2331
2338
  return React.createElement(SwapHistory, {
2332
2339
  onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
2333
2340
  //todo: move PendingSwap type to rango-types
2334
2341
  //@ts-ignore
2335
- pendingSwap: selectedSwap,
2342
+ pendingSwap: selectedSwap?.swap,
2336
2343
  onCopy: handleCopy,
2337
2344
  isCopied: isCopied,
2338
- //todo: implement swap cancellation (move queueManager logic to queueManager/rango-preset)
2339
- onCancel: requestId => console.log(requestId)
2345
+ onCancel: onCancel
2340
2346
  });
2341
2347
  }
2342
2348