Skip to content

Commit

Permalink
Fix withdraw error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunshon committed Feb 13, 2025
1 parent 7ec9cfd commit 664a857
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dashboard/Withdraw/RequestWithdrawBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@ function RequestWithdrawBtn( {
withdrawRequests.refresh();
} )
.catch( ( err ) => {
let message = __( 'Failed to create withdraw.', 'dokan' );

if ( err?.message ) {
// @ts-ignore
message = <RawHTML>{ err?.message }</RawHTML>;
}

toast( {
title:
err?.message ??
__( 'Failed to create withdraw.', 'dokan' ),
title: message,
type: 'error',
} );
console.error( 'Error creating withdraw:', err );
Expand Down

0 comments on commit 664a857

Please sign in to comment.