parent
3b6bd1c9f7
commit
2395cddcdf
2 changed files with 9 additions and 21 deletions
|
|
@ -1093,13 +1093,6 @@ export function handleSheetPriceResponse(country: string, content: any) {
|
||||||
sheetPriceLoading.set(false);
|
sheetPriceLoading.set(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function handleSheetPriceResponse(country: string, content: any) {
|
|
||||||
const resolvedCountry = country || get(streamingRawData).price?.country || '';
|
|
||||||
const chunks = Array.isArray(content) ? content : [content];
|
|
||||||
processSheetPriceData(resolvedCountry.toLowerCase(), [], chunks);
|
|
||||||
sheetPriceLoading.set(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset sheet price stores
|
// Reset sheet price stores
|
||||||
export function resetSheetPriceStore() {
|
export function resetSheetPriceStore() {
|
||||||
sheetPriceStreamMeta.set(null);
|
sheetPriceStreamMeta.set(null);
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,7 @@ export async function connectToWebsocket(id_token?: string) {
|
||||||
auth_data = get(authStore);
|
auth_data = get(authStore);
|
||||||
perms = get(permission);
|
perms = get(permission);
|
||||||
// Debug: check if auth_data has uid
|
// Debug: check if auth_data has uid
|
||||||
logger.info('[WS Auth] Sending auth info with:', {
|
logger.info('[WS Auth] Sending auth info with [REDACTED]');
|
||||||
uid: auth_data?.uid,
|
|
||||||
name: auth_data?.displayName,
|
|
||||||
email: auth_data?.email,
|
|
||||||
date: new Date()
|
|
||||||
});
|
|
||||||
const sent = await sendMessage({
|
const sent = await sendMessage({
|
||||||
type: 'auth',
|
type: 'auth',
|
||||||
payload: {
|
payload: {
|
||||||
|
|
@ -141,7 +136,7 @@ export async function connectToWebsocket(id_token?: string) {
|
||||||
}
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
logger.info(socket);
|
// logger.info(socket);
|
||||||
|
|
||||||
// heartbeat 10s
|
// heartbeat 10s
|
||||||
socketCheck = setInterval(async () => {
|
socketCheck = setInterval(async () => {
|
||||||
|
|
@ -209,13 +204,13 @@ export async function connectToWebsocket(id_token?: string) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.addEventListener('error', (e) => {
|
socket.addEventListener('error', (e) => {
|
||||||
// logger.info('WebSocket error: ', e);
|
// logger.info('WebSocket error: ', e);
|
||||||
socketStore.set(null);
|
socketStore.set(null);
|
||||||
wsAuthReady.set(false);
|
wsAuthReady.set(false);
|
||||||
sharedKey.set(null);
|
sharedKey.set(null);
|
||||||
clearInterval(socketCheck);
|
clearInterval(socketCheck);
|
||||||
});
|
});
|
||||||
} catch (socket_error: any) {
|
} catch (socket_error: any) {
|
||||||
if (ENABLE_WS_DEBUG) {
|
if (ENABLE_WS_DEBUG) {
|
||||||
logger.error('WS_ERR', socket_error);
|
logger.error('WS_ERR', socket_error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue