mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +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,12 +312,17 @@ 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) => {
|
||||||
if (revision.current != null) {
|
try {
|
||||||
revision.current = JSON.parse(ev.data);
|
if (revision.current != null) {
|
||||||
|
revision.current = JSON.parse(ev.data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
revision.current = JSON.parse(ev.data);
|
||||||
|
processRevision(token)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
catch (err) {
|
||||||
revision.current = JSON.parse(ev.data);
|
console.log(err);
|
||||||
processRevision(token)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ws.current.onclose = (e) => {
|
ws.current.onclose = (e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user