Skip to content

Commit

Permalink
Fixed share link expiration box being ineditable and always reloading…
Browse files Browse the repository at this point in the history
… invalid date

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
  • Loading branch information
claucambra committed May 16, 2022
1 parent fc8bfdc commit 31f3800
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/sharelinkwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,11 @@ void ShareLinkWidget::toggleExpireDateOptions(const bool enable)
const auto date = enable ? _linkShare->getExpireDate() : QDate::currentDate().addDays(1);
_ui->calendar->setDate(date);
_ui->calendar->setMinimumDate(QDate::currentDate().addDays(1));
_ui->calendar->setMaximumDate(
QDate::currentDate().addDays(_account->capabilities().sharePublicLinkExpireDateDays()));

if(_account->capabilities().sharePublicLinkExpireDateDays() > 0) {
_ui->calendar->setMaximumDate(QDate::currentDate().addDays(_account->capabilities().sharePublicLinkExpireDateDays()));
}

_ui->calendar->setFocus();

if (!enable && _linkShare && _linkShare->getExpireDate().isValid()) {
Expand Down

0 comments on commit 31f3800

Please sign in to comment.