mirror of
https://github.com/flarum/framework.git
synced 2025-05-01 17:14:05 +08:00
Use different CDN for loading Pusher JS library (#20)
Use jsDelivr to increase the loading speed (when compared to MaxCDN) in China.
This commit is contained in:
parent
912254864c
commit
74a1ebe813
@ -10,7 +10,7 @@ import Button from 'flarum/components/Button';
|
|||||||
app.initializers.add('flarum-pusher', () => {
|
app.initializers.add('flarum-pusher', () => {
|
||||||
const loadPusher = m.deferred();
|
const loadPusher = m.deferred();
|
||||||
|
|
||||||
$.getScript('//js.pusher.com/3.0/pusher.min.js', () => {
|
$.getScript('//cdn.jsdelivr.net/npm/pusher-js@3.0.0/dist/pusher.min.js', () => {
|
||||||
const socket = new Pusher(app.forum.attribute('pusherKey'), {
|
const socket = new Pusher(app.forum.attribute('pusherKey'), {
|
||||||
authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',
|
authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',
|
||||||
cluster: app.forum.attribute('pusherCluster'),
|
cluster: app.forum.attribute('pusherCluster'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user