From 0dc40a96740ad7c6bdda102b9441ab818efb2893 Mon Sep 17 00:00:00 2001 From: Michael Stingl Date: Thu, 5 Jun 2025 01:12:39 +0200 Subject: [PATCH] Fix quota display for unlimited storage (issue #11) - Hide 'available' space display when quota.total = 0 (unlimited) - Prevents showing confusing '9.22 EB available' for unlimited quotas - Matches web interface behavior which hides available space for unlimited quotas --- .../ClientItemViewController.swift | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/OpenCloudAppShared/Client/View Controllers/ClientItemViewController.swift b/OpenCloudAppShared/Client/View Controllers/ClientItemViewController.swift index 0106e227..41188af0 100644 --- a/OpenCloudAppShared/Client/View Controllers/ClientItemViewController.swift +++ b/OpenCloudAppShared/Client/View Controllers/ClientItemViewController.swift @@ -1245,14 +1245,17 @@ open class ClientItemViewController: CollectionViewController, SortBarDelegate, } if let driveQuota = driveQuota, let remainingBytes = driveQuota.remaining { - quotaInfoText = OCLocalizedFormat("{{remaining}} available", [ - "remaining" : ByteCountFormatter.string(fromByteCount: remainingBytes.int64Value, countStyle: .file) - ]) + // Only show available space if quota is not unlimited (total != 0) + if let totalBytes = driveQuota.total, totalBytes.int64Value != 0 { + quotaInfoText = OCLocalizedFormat("{{remaining}} available", [ + "remaining" : ByteCountFormatter.string(fromByteCount: remainingBytes.int64Value, countStyle: .file) + ]) - if folderStatisticsText.count > 0 { - folderStatisticsText += "\n" + quotaInfoText - } else { - folderStatisticsText = quotaInfoText + if folderStatisticsText.count > 0 { + folderStatisticsText += "\n" + quotaInfoText + } else { + folderStatisticsText = quotaInfoText + } } }