mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
catch and dismiss errors syncing
This commit is contained in:
parent
90493cf8ad
commit
3188385e75
@ -187,7 +187,7 @@ export function useAppContext() {
|
|||||||
cards.current.forEach((value, key, map) => {
|
cards.current.forEach((value, key, map) => {
|
||||||
if (value?.data?.cardDetail?.status === 'connected') {
|
if (value?.data?.cardDetail?.status === 'connected') {
|
||||||
value.channels.forEach((slot, key, map) => {
|
value.channels.forEach((slot, key, map) => {
|
||||||
merged.push({ contact: value?.data?.cardProfile?.guid, channel: slot });
|
merged.push({ guid: value?.data?.cardProfile?.guid, cardId: value?.id, channel: slot });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -312,6 +312,7 @@ export function useAppContext() {
|
|||||||
const setWebsocket = (token) => {
|
const setWebsocket = (token) => {
|
||||||
ws.current = new WebSocket("wss://" + window.location.host + "/status");
|
ws.current = new WebSocket("wss://" + window.location.host + "/status");
|
||||||
ws.current.onmessage = (ev) => {
|
ws.current.onmessage = (ev) => {
|
||||||
|
try {
|
||||||
if (revision.current != null) {
|
if (revision.current != null) {
|
||||||
revision.current = JSON.parse(ev.data);
|
revision.current = JSON.parse(ev.data);
|
||||||
}
|
}
|
||||||
@ -320,6 +321,10 @@ export function useAppContext() {
|
|||||||
processRevision(token)
|
processRevision(token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
ws.current.onclose = (e) => {
|
ws.current.onclose = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user