feat: implement fetchMe
This commit is contained in:
parent
0ea12e7f00
commit
58fe9a2eac
3 changed files with 13 additions and 3 deletions
|
@ -1,9 +1,12 @@
|
|||
import type { MessageProps } from "~/types/props";
|
||||
|
||||
const { fetchMe } = useApi()
|
||||
|
||||
export default async (element: HTMLDivElement, props: MessageProps) => {
|
||||
console.log("message:", element);
|
||||
const me = await fetchWithApi("/me") as any;
|
||||
if (props.author?.uuid == me.uuid) {
|
||||
const me = await fetchMe();
|
||||
|
||||
if (me && props.author?.uuid == me.uuid) {
|
||||
const text = element.getElementsByClassName("message-text")[0] as HTMLDivElement;
|
||||
text.contentEditable = "true";
|
||||
text.focus();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue