fix: mqtt

Deskripsi:
- hapus package mqtt

No Issues
This commit is contained in:
amel
2024-09-26 16:25:34 +08:00
parent 18f9ad9c80
commit dced0ad749
7 changed files with 6 additions and 298 deletions

View File

@@ -3,7 +3,6 @@ import { useHookstate } from "@hookstate/core";
import { globalNotifPage, globalRole, TEMA } from "../bin/val_global";
import { useShallowEffect } from "@mantine/hooks";
import { useEffect } from "react";
import mtqq_client from "../bin/mqtt_client";
export default function WrapLayout({ children, role, theme, user }: { children: React.ReactNode, role: any, theme: any, user: any }) {
const roleLogin = useHookstate(globalRole)
@@ -16,27 +15,6 @@ export default function WrapLayout({ children, role, theme, user }: { children:
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [role, theme])
useEffect(() => {
mtqq_client.on("connect", () => {
console.log('connect layout')
mtqq_client.subscribe("app_SDM")
})
mtqq_client.on("message", (topic, message) => {
const data = JSON.parse(message.toString())
console.log('notif mtqq',data)
// console.log('notif mtqq==',data)
// if (data.user == user) {
// notifLoadPage.set({
// load: !notifLoadPage.get(),
// category: data.category
// })
// }
})
})
return (
<>
{children}