diff --git a/config/language-translations.php b/config/language-translations.php index 8081bf5a..1c9bc605 100644 --- a/config/language-translations.php +++ b/config/language-translations.php @@ -501,8 +501,8 @@ return [ 'popup_deleted_user_aborted.title' => "User wasn't deleted", 'popup_error.message' => "Something went wrong and we can't continue. Please contact us.", 'popup_error.title' => 'Whooops, something went wrong!', - 'popup_exceed_limit.message' => 'Please contact your administrator to change your limit.', - 'popup_exceed_limit.title' => 'Whooops, you exceed storage limit :(', + 'popup_exceed_limit.message' => 'Please upgrade your account to change your limit.', + 'popup_exceed_limit.title' => 'You exceed storage limit', 'popup_mimetypes_blacklist.message' => 'File of this type ({mimetype}) is not allowed to upload.', 'popup_mimetypes_blacklist.title' => 'You are trying to upload unsupported file type', 'popup_move_item.cancel' => 'Cancel', diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 70688604..67eec03b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -545,5 +545,19 @@ "/js/main.7fcce007a830181b8076.hot-update.js": "/js/main.7fcce007a830181b8076.hot-update.js", "/chunks/invoices.0fc3648804617ab3f456.hot-update.js": "/chunks/invoices.0fc3648804617ab3f456.hot-update.js", "/chunks/invoices.3c88509d82835e292a67.hot-update.js": "/chunks/invoices.3c88509d82835e292a67.hot-update.js", - "/chunks/invoices.705b43cc74409c2e5b8f.hot-update.js": "/chunks/invoices.705b43cc74409c2e5b8f.hot-update.js" + "/chunks/invoices.705b43cc74409c2e5b8f.hot-update.js": "/chunks/invoices.705b43cc74409c2e5b8f.hot-update.js", + "/js/main.b95f73bb148600d91b55.hot-update.js": "/js/main.b95f73bb148600d91b55.hot-update.js", + "/js/main.ca8d78ccf4aabe01eb0b.hot-update.js": "/js/main.ca8d78ccf4aabe01eb0b.hot-update.js", + "/js/main.1916a7395ff464335236.hot-update.js": "/js/main.1916a7395ff464335236.hot-update.js", + "/js/main.6f2ae936594ea5cc2014.hot-update.js": "/js/main.6f2ae936594ea5cc2014.hot-update.js", + "/js/main.304c91d0372502435a0b.hot-update.js": "/js/main.304c91d0372502435a0b.hot-update.js", + "/js/main.71254a37385ec1585431.hot-update.js": "/js/main.71254a37385ec1585431.hot-update.js", + "/js/main.f2c3546dec7a674525ff.hot-update.js": "/js/main.f2c3546dec7a674525ff.hot-update.js", + "/js/main.d5524d4a0e6fd0f29b85.hot-update.js": "/js/main.d5524d4a0e6fd0f29b85.hot-update.js", + "/js/main.a1f0eebf13ea1c14bfc5.hot-update.js": "/js/main.a1f0eebf13ea1c14bfc5.hot-update.js", + "/js/main.bc54f89fe669868b1cc3.hot-update.js": "/js/main.bc54f89fe669868b1cc3.hot-update.js", + "/js/main.c85b0e6c1c407b517efa.hot-update.js": "/js/main.c85b0e6c1c407b517efa.hot-update.js", + "/js/main.6d054575b90412bd027d.hot-update.js": "/js/main.6d054575b90412bd027d.hot-update.js", + "/js/main.1b9dd6c7b70765387854.hot-update.js": "/js/main.1b9dd6c7b70765387854.hot-update.js", + "/js/main.1be136e3d8e2c392d8aa.hot-update.js": "/js/main.1be136e3d8e2c392d8aa.hot-update.js" } diff --git a/resources/js/helpers/functionHelpers.js b/resources/js/helpers/functionHelpers.js index 6905c0f7..3b0acdeb 100644 --- a/resources/js/helpers/functionHelpers.js +++ b/resources/js/helpers/functionHelpers.js @@ -236,18 +236,19 @@ const FunctionHelpers = { totalUploadedSize: uploadedSize }).then(() => { uploadedSize = uploadedSize + chunk.size - }).catch((error) => { + }).catch(error => { // Count attempts attempts++ // Show Error - if (attempts === 3) - this.$isSomethingWrong() + //if (attempts === 3) // Break uploading process - if ([500, 422].includes(error.response.status)) + if ([500, 422].includes(error.response.status)) { isNotGeneralError = false + this.$isSomethingWrong() + } }) } while (isNotGeneralError && attempts !== 0 && attempts !== 3) diff --git a/resources/js/store/modules/fileFunctions.js b/resources/js/store/modules/fileFunctions.js index e8ba2744..ce2fd484 100644 --- a/resources/js/store/modules/fileFunctions.js +++ b/resources/js/store/modules/fileFunctions.js @@ -225,9 +225,6 @@ const actions = { } } - console.log(error.response); - console.log(error.response.status); - events.$emit('alert:open', { emoji: '😬😬😬', title: messages[error.response.status]['title'], diff --git a/src/App/Users/Models/User.php b/src/App/Users/Models/User.php index d5f8aac2..18523765 100644 --- a/src/App/Users/Models/User.php +++ b/src/App/Users/Models/User.php @@ -3,6 +3,7 @@ namespace App\Users\Models; use ByteUnits\Metric; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; use Domain\Files\Models\File; use Domain\Folders\Models\Folder; @@ -141,8 +142,9 @@ class User extends Authenticatable implements MustVerifyEmail */ public function getUsedCapacityAttribute(): int { - return $this->filesWithTrashed - ->map(fn($item) => $item->getRawOriginal())->sum('filesize'); + return DB::table('files') + ->where('user_id', $this->id) + ->sum('filesize'); } /** diff --git a/src/Support/helpers.php b/src/Support/helpers.php index 0e638794..b0bf831f 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -484,12 +484,8 @@ if (! function_exists('get_storage_fill_percentage')) { if (! function_exists('user_storage_percentage')) { /** * Get user capacity fill by percentage - * - * @param $id - * @param null $additionals - * @return string */ - function user_storage_percentage($id, $additionals = null) + function user_storage_percentage($id, int $additionals = null) { $user = User::findOrFail($id);