-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: init pusher-client inside useEffect, otherwise it doest not work
fix: add tls to pusher client as well fix: pusher client display CORS error (#123) fix: missing pusher channel env value fix: git action syntax incorrect fix: missing app key and app cluster fix: turn of channel authorization fix: try to use lower push-js version (v8.3.0) fix: try to use pusher inside useEffect fix: enable TLS config for pusher fix: add tls to pusher client as well fix: pusher client display CORS error (#123) fix: missing app key and app cluster fix: turn of channel authorization fix: try to use lower push-js version (v8.3.0) fix: try to use pusher inside useEffect
- Loading branch information
Showing
7 changed files
with
93 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Pusher, { Channel } from 'pusher-js' | ||
import { useEffect, useState } from 'react' | ||
|
||
export const usePusher = () => { | ||
const [channelTeamCollab, setChannelTeamCollab] = useState<Channel>() | ||
useEffect(() => { | ||
|
||
const pusherClient = new Pusher( | ||
process.env.NEXT_PUBLIC_PUSHER_CHANNEL_APP_KEY || '', | ||
{ | ||
cluster: process.env.NEXT_PUBLIC_PUSHER_CHANNEL_APP_CLUSTER || '', | ||
// channelAuthorization: { | ||
// transport: 'ajax', | ||
// endpoint: `${process.env.NEXT_PUBLIC_BE_GATEWAY}api/buzzer/channel-auth` | ||
// } | ||
|
||
} | ||
) | ||
|
||
|
||
const channel = pusherClient.subscribe('team-collab') | ||
|
||
setChannelTeamCollab(channel) | ||
|
||
}, []) | ||
|
||
return { | ||
channelTeamCollab | ||
} | ||
} |