This commit is contained in:
reya
2024-10-26 17:24:39 +07:00
parent 470dc1c759
commit 83d24351cd
13 changed files with 191 additions and 496 deletions
+1 -24
View File
@@ -1,4 +1,4 @@
import { events, commands } from "@/commands.gen";
import { commands } from "@/commands.gen";
import { Note, ReplyNote, Spinner } from "@/components";
import { LumeEvent, useEvent } from "@/system";
import type { EventPayload } from "@/types";
@@ -91,7 +91,6 @@ function RootEvent() {
}
function ReplyList() {
const { label } = Route.useSearch();
const { id } = Route.useParams();
const { queryClient } = Route.useRouteContext();
const { data, isLoading } = useQuery({
@@ -179,28 +178,6 @@ function ReplyList() {
refetchOnWindowFocus: false,
});
useEffect(() => {
events.subscription
.emit({
label: label || id,
kind: "Subscribe",
event_id: id,
contacts: null,
})
.then(() => console.log("Subscribe: ", label));
return () => {
events.subscription
.emit({
label: label || id,
kind: "Unsubscribe",
event_id: id,
contacts: null,
})
.then(() => console.log("Unsubscribe: ", label));
};
}, []);
useEffect(() => {
const unlisten = getCurrentWindow().listen<EventPayload>(
"event",
@@ -1,4 +1,4 @@
import { events, commands } from "@/commands.gen";
import { commands } from "@/commands.gen";
import { toLumeEvents } from "@/commons";
import { RepostNote, Spinner, TextNote } from "@/components";
import type { LumeEvent } from "@/system";
@@ -83,28 +83,6 @@ export function Screen() {
[data],
);
useEffect(() => {
events.subscription
.emit({
label: search.label as string,
kind: "Subscribe",
event_id: null,
contacts,
})
.then(() => console.log("Subscribe: ", search.label));
return () => {
events.subscription
.emit({
label: search.label as string,
kind: "Unsubscribe",
event_id: null,
contacts,
})
.then(() => console.log("Unsubscribe: ", search.label));
};
}, []);
useEffect(() => {
const unlisten = listen("synchronized", async () => {
await queryClient.refetchQueries({