mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #5472 from nextcloud/work/fix-infinite-loading-share-dialog-disabled-share-links
Fix infinite loading in the share dialog when public link shares are disabled on the server
This commit is contained in:
commit
33e1a900ad
@ -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;
|
||||
}
|
||||
@ -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)
|
||||
@ -481,7 +480,6 @@ void ShareModel::slotAddShare(const SharePtr &share)
|
||||
}
|
||||
|
||||
handlePlaceholderLinkShare();
|
||||
Q_EMIT sharesChanged();
|
||||
}
|
||||
|
||||
void ShareModel::slotRemoveShareWithId(const QString &shareId)
|
||||
@ -508,8 +506,6 @@ void ShareModel::slotRemoveShareWithId(const QString &shareId)
|
||||
endRemoveRows();
|
||||
|
||||
handlePlaceholderLinkShare();
|
||||
|
||||
Q_EMIT sharesChanged();
|
||||
}
|
||||
|
||||
void ShareModel::slotServerError(const int code, const QString &message)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user