Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
everything working. just need to test premium features
Browse files Browse the repository at this point in the history
  • Loading branch information
matievisthekat committed Jan 13, 2021
1 parent a751d02 commit 7b930f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ const App: React.FC = () => {
const io = socketIo(url);
io.connect()
.on("connect_error", (err: any) => {
console.error(err);
setError("Failed to connect.");
setConnecting(false);
setConnected(false);
if (!io.connected) {
console.error(err);
setError("Failed to connect.");
setConnecting(false);
setConnected(false);
}
})
.on("connect", () => {
console.log("WebSocket connected");
Expand All @@ -60,6 +62,8 @@ const App: React.FC = () => {
setError("Disconnected from server");
setConnected(false);
setSocket(null);

setTimeout(() => io.connect(), 1500);
})
.on("initial_state", (state: SocketState) => {
setTrack(state.item);
Expand Down

0 comments on commit 7b930f5

Please sign in to comment.