summaryrefslogtreecommitdiffstats
path: root/src/store/fileUploadStore.js
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-01-27 17:26:54 +0100
committerVincent Petry <vincent@nextcloud.com>2021-01-28 16:02:07 +0100
commitb8fd42777240075f6452fc13f8a384c5b94ca679 (patch)
tree93239442e9f8a6779bcef74499982746bb20a372 /src/store/fileUploadStore.js
parentdcbb63d4e54f40cbcb0bc76c31d0d641f8f191de (diff)
Hide upload button with zero quota
Whenever a user has zero quota, for example like guest app users, don't display the upload button. The quota value is retrieved for the attachment folder. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src/store/fileUploadStore.js')
-rw-r--r--src/store/fileUploadStore.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/store/fileUploadStore.js b/src/store/fileUploadStore.js
index 03c21591b..07a52325f 100644
--- a/src/store/fileUploadStore.js
+++ b/src/store/fileUploadStore.js
@@ -31,6 +31,7 @@ import { shareFile } from '../services/filesSharingServices'
const state = {
attachmentFolder: loadState('spreed', 'attachment_folder'),
+ attachmentFolderFreeSpace: loadState('spreed', 'attachment_folder_free_space'),
uploads: {
},
currentUploadId: undefined,
@@ -76,6 +77,11 @@ const getters = {
return state.attachmentFolder
},
+ // gets the current attachment folder
+ getAttachmentFolderFreeSpace: (state) => () => {
+ return state.attachmentFolderFreeSpace
+ },
+
uploadProgress: (state) => (uploadId, index) => {
if (state.uploads[uploadId].files[index]) {
return state.uploads[uploadId].files[index].uploadedSize / state.uploads[uploadId].files[index].totalSize * 100