the browser-facing portion of osu!
at master 25 lines 853 B view raw
1{{-- 2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 3 See the LICENCE file in the repository root for full licence text. 4--}} 5@php 6 $currentUser ??= Auth::user(); 7 8 $currentUserJson = $currentUser === null 9 ? '{}' 10 : json_encode(json_item($currentUser, new App\Transformers\CurrentUserTransformer())); 11@endphp 12<script id="json-current-user" type="application/json"> 13 {!! $currentUserJson !!} 14</script> 15<script> 16 {{-- 17 Set current user on first page load. Further updates are done in 18 reactTurbolinks before the new page is rendered. 19 This needs to be fired before everything else (turbo:load etc). 20 --}} 21 if (!osuCore.firstCurrentUserSet) { 22 osuCore.firstCurrentUserSet = true; 23 osuCore.updateCurrentUser(); 24 } 25</script>