Revert Use Tauri Websocket

This commit is contained in:
MystiPanda
2024-01-15 10:17:00 +08:00
parent 6d3ea19ac5
commit 8fc4b338c2
9 changed files with 49 additions and 144 deletions

View File

@@ -16,7 +16,7 @@ export const useLogSetup = () => {
const setLogData = useSetRecoilState(atomLogData);
const { connect, disconnect } = useWebsocket((event) => {
const data = JSON.parse(event) as ILogItem;
const data = JSON.parse(event.data) as ILogItem;
const time = dayjs().format("MM-DD HH:mm:ss");
setLogData((l) => {
if (l.length >= MAX_LOG_NUM) l.shift();