Skip to content

Commit

Permalink
Merge pull request #5472 from nextcloud/work/fix-infinite-loading-sha…
Browse files Browse the repository at this point in the history
…re-dialog-disabled-share-links

Fix infinite loading in the share dialog when public link shares are disabled on the server
  • Loading branch information
claucambra authored Mar 1, 2023
2 parents 9b4cc36 + 2e69a9c commit 33e1a90
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/gui/filedetails/sharemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ void ShareModel::initShareManager()
}

bool sharingPossible = true;
if (!publicLinkSharesEnabled()) {
qCWarning(lcSharing) << "Link shares have been disabled";
sharingPossible = false;
} else if (!canShare()) {
if (!canShare()) {
qCWarning(lcSharing) << "The file cannot be shared because it does not have sharing permission.";
sharingPossible = false;
}
Expand Down Expand Up @@ -345,9 +342,11 @@ void ShareModel::handlePlaceholderLinkShare()

if (linkSharePresent && placeholderLinkSharePresent) {
slotRemoveShareWithId(placeholderLinkShareId);
} else if (!linkSharePresent && !placeholderLinkSharePresent) {
} else if (!linkSharePresent && !placeholderLinkSharePresent && publicLinkSharesEnabled()) {
slotAddShare(_placeholderLinkShare);
}

Q_EMIT sharesChanged();
}

void ShareModel::slotPropfindReceived(const QVariantMap &result)
Expand Down Expand Up @@ -481,7 +480,6 @@ void ShareModel::slotAddShare(const SharePtr &share)
}

handlePlaceholderLinkShare();
Q_EMIT sharesChanged();
}

void ShareModel::slotRemoveShareWithId(const QString &shareId)
Expand All @@ -508,8 +506,6 @@ void ShareModel::slotRemoveShareWithId(const QString &shareId)
endRemoveRows();

handlePlaceholderLinkShare();

Q_EMIT sharesChanged();
}

void ShareModel::slotServerError(const int code, const QString &message)
Expand Down

0 comments on commit 33e1a90

Please sign in to comment.