Skip to content

Commit

Permalink
fix: remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alessey committed Sep 13, 2024
1 parent e6a142f commit bd087b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/swap/components/SwapProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,6 @@ export function SwapProvider({
return;
}

// is this needed? odd to have init here
// updateLifeCycleStatus({
// statusName: 'init',
// statusData: {
// isMissingRequiredField: false,
// maxSlippage: initialMaxSlippage,
// },
// });

try {
const maxSlippage = lifeCycleStatus.statusData.maxSlippage;
const response = await buildSwapTransaction({
Expand Down
9 changes: 6 additions & 3 deletions src/swap/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ export type LifeCycleStatusUpdate = LifeCycleStatus extends infer T
? T extends { statusName: infer N; statusData: infer D }
? { statusName: N } & (
N extends "init"
? { statusData: D } // leave statusData required if statusName is "init"
: AllKeysInShared<D> extends true // if statusData only contains LifeCycleStatusDataShared, make statusData optional
? { statusData?: PartialKeys<D, keyof D & keyof LifeCycleStatusDataShared> } // make all keys in LifeCycleStatusDataShared optional
// leave statusData required if statusName is "init"
? { statusData: D }
// if statusData only contains LifeCycleStatusDataShared, make statusData optional
: AllKeysInShared<D> extends true
// make all keys in LifeCycleStatusDataShared optional
? { statusData?: PartialKeys<D, keyof D & keyof LifeCycleStatusDataShared> }
: { statusData: PartialKeys<D, keyof D & keyof LifeCycleStatusDataShared> }
)
: never
Expand Down

0 comments on commit bd087b0

Please sign in to comment.