Skip to content

Commit 9a87b9f

Browse files
joshtrichardsnextcloud-command
authored andcommitted
fix(files): Dont't warn re: full storage on either zero or unlimited quotas
Fixes #43535 Fixes #43280 Replaces #43544 Signed-off-by: Josh <josh.t.richards@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 5a5a896 commit 9a87b9f

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

apps/files/src/components/NavigationQuota.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,17 @@ export default {
8888
},
8989
9090
mounted() {
91-
// Warn the user if the available storage is 0 on page load
92-
if (this.storageStats?.free <= 0) {
91+
// If the user has a quota set, warn if the available account storage is <=0
92+
//
93+
// NOTE: This doesn't catch situations where actual *server*
94+
// disk (non-quota) space is low, but those should probably
95+
// be handled differently anyway since a regular user can't
96+
// can't do much about them (If we did want to indicate server disk
97+
// space matters to users, we'd probably want to use a warning
98+
// specific to that situation anyhow. So this covers warning covers
99+
// our primary day-to-day concern (individual account quota usage).
100+
//
101+
if (this.storageStats?.quota > 0 && this.storageStats?.free <= 0) {
93102
this.showStorageFullWarning()
94103
}
95104
},
@@ -122,8 +131,9 @@ export default {
122131
throw new Error('Invalid storage stats')
123132
}
124133
125-
// Warn the user if the available storage changed from > 0 to 0
126-
if (this.storageStats?.free > 0 && response.data.data?.free <= 0) {
134+
// Warn the user if the available account storage changed from > 0 to 0
135+
// (unless only because quota was intentionally set to 0 by admin in the interim)
136+
if (this.storageStats?.free > 0 && response.data.data?.free <= 0 && response.data.data?.quota > 0) {
127137
this.showStorageFullWarning()
128138
}
129139

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)