Don't show verify button if CS is not enable
authorAjay Bura <ajbura@gmail.com>
Sun, 29 May 2022 04:17:30 +0000 (09:47 +0530)
committerAjay Bura <ajbura@gmail.com>
Sun, 29 May 2022 04:17:30 +0000 (09:47 +0530)
src/app/organisms/settings/DeviceManage.jsx

index dad5b96d540ecd4dc468e0facfdec0cb05e534c8..062ec02112d5e50bd82e9845e3014d9c93dda9ec 100644 (file)
@@ -155,6 +155,7 @@ function DeviceManage() {
     const lastIP = device.last_seen_ip;
     const lastTS = device.last_seen_ts;
     const isCurrentDevice = mx.deviceId === deviceId;
+    const canVerify = isVerified === false && (isMeVerified || isCurrentDevice);
 
     return (
       <SettingTile
@@ -171,7 +172,7 @@ function DeviceManage() {
             ? <Spinner size="small" />
             : (
               <>
-                {((isMeVerified && isVerified === false) || (isCurrentDevice && isVerified === false)) && <Button onClick={() => verify(deviceId, isCurrentDevice)} variant="positive">Verify</Button>}
+                {(isCSEnabled && canVerify) && <Button onClick={() => verify(deviceId, isCurrentDevice)} variant="positive">Verify</Button>}
                 <IconButton size="small" onClick={() => handleRename(device)} src={PencilIC} tooltip="Rename" />
                 <IconButton size="small" onClick={() => handleRemove(device)} src={BinIC} tooltip="Remove session" />
               </>