Skip to content

Commit

Permalink
[DDW-881] Throw an error in the DialogContainer if there is no dialog…
Browse files Browse the repository at this point in the history
…Type provided
  • Loading branch information
szymonmaslowski committed Jan 31, 2022
1 parent 3f07798 commit 3a070aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/renderer/app/components/wallet/WalletSendForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,10 @@ export default class WalletSendForm extends Component<Props, State> {
/>
) : null}

<DialogContainer ref={this.walletTokenPickerRef}>
<DialogContainer
ref={this.walletTokenPickerRef}
dialogType={WalletTokenPicker}
>
<WalletTokenPicker
assets={assets}
previouslyCheckedIds={selectedAssetUniqueIds}
Expand Down
5 changes: 5 additions & 0 deletions source/renderer/app/containers/DialogContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ const DialogContainer: StatelessFunctionalComponent<Props> = ({
forwardedRef,
stores,
}: Props) => {
if (!dialogType) {
throw new Error('Dialog type is required');
}

const isOpen = useCallback(() => stores.uiDialogs.isOpen(dialogType), [
dialogType,
stores,
]);

Expand Down

0 comments on commit 3a070aa

Please sign in to comment.