2024-03-08 19:18:53 +01:00
|
|
|
// Handling connection errors
|
|
|
|
socket.on("reconnecting", (number) => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: `${window.locale["Reconnecting"]} ${number}`,
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("reconnect", () => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: window.locale["Reconnected"],
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("reconnect_error", () => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: window.locale["Reconnection error occured"],
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("reconnect_failed", () => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: window.locale["Reconnection failed"],
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("disconnect", () => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: `${window.locale["Disconnected"]}\n${window.locale["Try to refresh the page if this error reoccurs"]}`,
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("error", () => {
|
|
|
|
Toastify({
|
2024-03-27 15:51:33 +01:00
|
|
|
text: window.locale["Connection error"],
|
2024-03-08 19:18:53 +01:00
|
|
|
duration: 5000,
|
|
|
|
newWindow: true,
|
|
|
|
gravity: "bottom",
|
|
|
|
position: "right",
|
|
|
|
stopOnFocus: true,
|
|
|
|
className: "bshipstoast",
|
|
|
|
}).showToast();
|
|
|
|
});
|