-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ SW-467 ] fix(threshold-info): Display right info in the change thre…
…shold confirmation screen (#4465) * fix(threshold-info): remove 0 information from the threshold confirmation screen * fix(threshold-info): use isChangeThresholdView guard
- Loading branch information
1 parent
a7f6ac2
commit 35decc8
Showing
5 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { createContext } from 'react' | ||
|
||
export const ChangeThresholdReviewContext = createContext({ | ||
newThreshold: 0, | ||
}) | ||
export const ChangeThresholdReviewContext = createContext<{ newThreshold?: number }>({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import type { TransactionInfo } from '@safe-global/safe-gateway-typescript-sdk' | ||
import type { ChangeThreshold, SettingsChange, TransactionInfo } from '@safe-global/safe-gateway-typescript-sdk' | ||
import { SettingsInfoType, TransactionInfoType } from '@safe-global/safe-gateway-typescript-sdk' | ||
import { ConfirmBatchFlow } from '@/components/tx-flow/flows' | ||
|
||
export const isSettingsChangeView = (txInfo: TransactionInfo) => txInfo.type === TransactionInfoType.SETTINGS_CHANGE | ||
|
||
export const isConfirmBatchView = (txFlow?: JSX.Element) => txFlow?.type === ConfirmBatchFlow | ||
|
||
export const isChangeThresholdView = (txInfo: TransactionInfo) => | ||
export const isChangeThresholdView = ( | ||
txInfo: TransactionInfo, | ||
): txInfo is SettingsChange & { settingsInfo: ChangeThreshold } => | ||
txInfo.type === TransactionInfoType.SETTINGS_CHANGE && txInfo.settingsInfo?.type === SettingsInfoType.CHANGE_THRESHOLD |