From a8fa81ef5c89cb8889bc0b21a5c94b650d26410c Mon Sep 17 00:00:00 2001 From: Majd Al Mnayer Date: Tue, 15 Oct 2024 10:24:46 -0400 Subject: [PATCH] feat: displayed QR error in same QR img modal --- .../routes/App/FileTransfer/FileTransfer.js | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/client/src/routes/App/FileTransfer/FileTransfer.js b/client/src/routes/App/FileTransfer/FileTransfer.js index e9a1a3a..53e73f3 100644 --- a/client/src/routes/App/FileTransfer/FileTransfer.js +++ b/client/src/routes/App/FileTransfer/FileTransfer.js @@ -447,16 +447,6 @@ class FileTransfer extends PureComponent { ); - case constants.QR_CODE_LOAD_FAILED: - return ( - <> -

Connection Error!

-

Unable to load QR code, try refreshing this page

- - - ); case constants.ERR_CONN_CLOSED: default: return ( @@ -598,24 +588,28 @@ class FileTransfer extends PureComponent { this.toggleQRCodeModal(false)}>

Room QR code

-

Scan this QR code to join "{this.client.room}" file sharing room.

- - {`QR { - this.setState({ - errorModal: { - isOpen: true, - type: constants.QR_CODE_LOAD_FAILED - }, - }); - - this.toggleQRCodeModal(false); - }} - /> - + { + this.state.errorModal.type === constants.QR_CODE_LOAD_FAILED ? ( +

Could not load QR code

+ ) : ( + <> +

Scan this QR code to join "{this.client.room}" file sharing room.

+ {`QR { + this.setState({ + errorModal: { + isOpen: true, + type: constants.QR_CODE_LOAD_FAILED + }, + }); + }} + /> + + ) + }