feat: heartbeat check if connection offline
- WIP price message Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
a0637c7d72
commit
4578a43197
4 changed files with 69 additions and 17 deletions
|
|
@ -15,6 +15,7 @@ import { buildOverviewFromServer } from '$lib/data/recipeService';
|
|||
import { auth } from '../client/firebase';
|
||||
import { type RecipeVersion } from '$lib/models/recipe_version.model';
|
||||
import { goto } from '$app/navigation';
|
||||
import { socketAlreadySendHeartbeat, socketConnectionOfflineCount } from '../stores/websocketStore';
|
||||
|
||||
export const messages = writable<string[]>([]);
|
||||
|
||||
|
|
@ -207,6 +208,18 @@ const handlers: Record<string, (payload: any) => void> = {
|
|||
|
||||
currentRecipeVersionsSelector.set(result);
|
||||
}
|
||||
},
|
||||
price: (p) => {
|
||||
let req_action = p.req_action;
|
||||
let status = p.status;
|
||||
let to = p.to;
|
||||
|
||||
let content = p.content ?? [];
|
||||
},
|
||||
heartbeat: (p) => {
|
||||
socketConnectionOfflineCount.set(0);
|
||||
socketAlreadySendHeartbeat.set(0);
|
||||
console.log('heartbeat reset offline count');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue