Commit 73ff9804 authored by Chunchi Che's avatar Chunchi Che

finish async blocking

parent 1baf87eb
import { Button, Popover, Space } from "antd"; import { Button, Popover, Space } from "antd";
import { useState } from "react"; import { useState } from "react";
import { eventEmitter, Task } from "@/infra"; import { eventbus, Task } from "@/infra";
import { IconFont } from "../Shared"; import { IconFont } from "../Shared";
...@@ -22,8 +22,9 @@ export const MoraPopover: React.FC< ...@@ -22,8 +22,9 @@ export const MoraPopover: React.FC<
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
// 需要在mora的service之中,emit一个事件,让这个组件监听到,然后打开popover // 需要在mora的service之中,emit一个事件,让这个组件监听到,然后打开popover
eventEmitter.on(Task.Mora, () => { eventbus.register(Task.Mora, async () => {
setOpen(true); setOpen(true);
return true;
}); });
const onClick = (result: Mora) => { const onClick = (result: Mora) => {
...@@ -70,8 +71,9 @@ export const TpPopover: React.FC< ...@@ -70,8 +71,9 @@ export const TpPopover: React.FC<
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
// 需要在mora的service之中,emit一个事件,让这个组件监听到,然后打开popover // 需要在mora的service之中,emit一个事件,让这个组件监听到,然后打开popover
eventEmitter.on(Task.Tp, () => { eventbus.register(Task.Tp, async () => {
setOpen(true); setOpen(true);
return true;
}); });
const onClick = (result: Tp) => { const onClick = (result: Tp) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment