diff --git a/app/Http/Controllers/UserCoverPresetsController.php b/app/Http/Controllers/UserCoverPresetsController.php index 87bdfa70122..2a8302b0cbe 100644 --- a/app/Http/Controllers/UserCoverPresetsController.php +++ b/app/Http/Controllers/UserCoverPresetsController.php @@ -82,6 +82,6 @@ public function update(string $id): Response $item->update(['active' => $params['active']]); } - return ujs_redirect(route('user-cover-presets.index').'#cover-'.$item->getKey()); + return response(null, 204); } } diff --git a/resources/js/setup-turbo.ts b/resources/js/setup-turbo.ts index f6c0e566b4d..b2f7bb2eb67 100644 --- a/resources/js/setup-turbo.ts +++ b/resources/js/setup-turbo.ts @@ -3,6 +3,7 @@ import '@hotwired/turbo'; import { hideLoadingOverlay, showLoadingOverlay } from 'utils/loading-overlay'; +import { reloadPage } from 'utils/turbolinks'; Turbo.config.drive.progressBarDelay = 0; @@ -17,6 +18,11 @@ document.addEventListener('turbo:submit-start', (e) => { } }); document.addEventListener('turbo:submit-end', hideLoadingOverlay); +document.addEventListener('turbo:submit-end', (e) => { + if (e.detail.success && e.detail.formSubmission.formElement.dataset.reloadOnSuccess === '1') { + reloadPage(); + } +}); // disable turbo navigation for old webs document.addEventListener('turbo:click', (event) => { diff --git a/resources/views/layout/ujs-redirect.blade.php b/resources/views/layout/ujs-redirect.blade.php index 84052e14c6a..fe651fb8e7a 100644 --- a/resources/views/layout/ujs-redirect.blade.php +++ b/resources/views/layout/ujs-redirect.blade.php @@ -2,7 +2,6 @@ Copyright (c) ppy Pty Ltd . Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} -;(function() { - $(document).off(".ujsHideLoadingOverlay"); - window.setTimeout(() => Turbo.visit({!! json_encode($url) !!}), 0); -}).call(this); +$(document).off('.ujsHideLoadingOverlay'); +Turbo.cache.clear(); +Turbo.visit({!! json_encode($url) !!}); diff --git a/resources/views/password_reset/index.blade.php b/resources/views/password_reset/index.blade.php index d8235e796cb..e4af3c8658a 100644 --- a/resources/views/password_reset/index.blade.php +++ b/resources/views/password_reset/index.blade.php @@ -22,7 +22,6 @@

- + + +

@csrf