mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-01 07:52:00 -05:00
fix: socket.io
- this makes it so socket.io only loads on home page where its needed for chatbox and not globally which was causing socket.io to load on all pages when it was not even needed. Thus a performance increase now.
This commit is contained in:
Vendored
-14
@@ -45,20 +45,6 @@ if (token) {
|
||||
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
|
||||
}
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
import Echo from 'laravel-echo';
|
||||
|
||||
window.io = require('socket.io-client');
|
||||
|
||||
window.Echo = new Echo({
|
||||
broadcaster: 'socket.io',
|
||||
host: process.env.MIX_ECHO_ADDRESS,
|
||||
});
|
||||
|
||||
/*
|
||||
* NPM Packages
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
import Echo from 'laravel-echo';
|
||||
|
||||
window.io = require('socket.io-client');
|
||||
|
||||
window.Echo = new Echo({
|
||||
broadcaster: 'socket.io',
|
||||
host: process.env.MIX_ECHO_ADDRESS,
|
||||
});
|
||||
@@ -6,16 +6,18 @@
|
||||
|
||||
@if (!auth()->user()->chat_hidden)
|
||||
<div id="vue">
|
||||
<script src="{{ mix('js/chat.js') }}" crossorigin="anonymous"></script>
|
||||
@include('blocks.chat')
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('blocks.featured')
|
||||
@livewire('random-media')
|
||||
@include('blocks.poll')
|
||||
@include('blocks.top_torrents')
|
||||
@include('blocks.top_uploaders')
|
||||
@include('blocks.latest_topics')
|
||||
@include('blocks.latest_posts')
|
||||
@include('blocks.online')
|
||||
{{--@include('blocks.top_torrents')--}}
|
||||
{{--@include('blocks.top_uploaders')--}}
|
||||
@include('blocks.latest_topics')
|
||||
@include('blocks.latest_posts')
|
||||
@include('blocks.online')
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
+2
-1
@@ -67,4 +67,5 @@ mix.options({
|
||||
*/
|
||||
.js('resources/js/unit3d/imgbb.js', 'public/js')
|
||||
.js('resources/js/vendor/alpine.js', 'public/js')
|
||||
.js('resources/js/vendor/virtual-select.js', 'public/js');
|
||||
.js('resources/js/vendor/virtual-select.js', 'public/js')
|
||||
.js('resources/js/unit3d/chat.js', 'public/js');
|
||||
|
||||
Reference in New Issue
Block a user