Skip to content

Commit c91bccb

Browse files
committed
fix
1 parent 46c50f8 commit c91bccb

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/gui/nmcgui/nmcaccountsettings.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,22 @@ void NMCAccountSettings::setLayout()
251251
auto *e2eeButtonContainerLayout = new QVBoxLayout(e2eeButtonContainer);
252252
setupTransparentLayout(e2eeButtonContainerLayout, 8);
253253

254-
auto normalizeEncryptionLayout = [this, e2eeButtonContainerLayout]() {
254+
auto updateE2eePanelVisibility = [this, e2eePanel]() {
255+
const auto accountState = accountsState();
256+
const auto account = accountState ? accountState->account() : nullptr;
257+
258+
const bool visible = account
259+
&& account->capabilities().clientSideEncryptionAvailable();
260+
261+
e2eePanel->setVisible(visible);
262+
return visible;
263+
};
264+
265+
auto normalizeEncryptionLayout = [this, e2eeButtonContainerLayout, updateE2eePanelVisibility]() {
266+
if (!updateE2eePanelVisibility()) {
267+
return;
268+
}
269+
255270
getUi()->encryptionMessageIcon->clear();
256271
getUi()->encryptionMessageIcon->hide();
257272

@@ -396,6 +411,7 @@ void NMCAccountSettings::setLayout()
396411

397412
getUi()->encryptionMessage->hide();
398413
checkClientSideEncryptionState();
414+
updateE2eePanelVisibility();
399415

400416
QTimer::singleShot(0, this, normalizeEncryptionLayout);
401417
}

0 commit comments

Comments
 (0)