feat: update commands
This commit is contained in:
@@ -63,9 +63,9 @@ try {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getChatMessages(sender: string) : Promise<Result<string[], string>> {
|
||||
async getChatMessages(id: string) : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_chat_messages", { sender }) };
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_chat_messages", { id }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
|
||||
@@ -12,7 +12,7 @@ export function UserName({ className }: { className?: string }) {
|
||||
|
||||
if (user.isLoading) {
|
||||
return (
|
||||
<div className="size-4 w-20 bg-black/10 dark:bg-white/10 animate-pulse" />
|
||||
<div className="size-4 w-20 rounded bg-black/10 dark:bg-white/10 animate-pulse" />
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ function List() {
|
||||
ref={ref}
|
||||
className="relative h-full py-2 [&>div]:!flex [&>div]:flex-col [&>div]:justify-end [&>div]:min-h-full"
|
||||
>
|
||||
<Virtualizer scrollRef={ref} shift>
|
||||
<Virtualizer scrollRef={ref}>
|
||||
{isLoading || !data ? (
|
||||
<div className="w-full h-56 flex items-center justify-center">
|
||||
<div className="flex items-center gap-1.5">
|
||||
|
||||
@@ -127,7 +127,7 @@ function ChatList() {
|
||||
<ScrollArea.Viewport className="relative h-full px-1.5">
|
||||
{isLoading ? (
|
||||
<div>
|
||||
{Array.from(Array(5)).map((index) => (
|
||||
{Array.from(Array(5)).map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex items-center rounded-lg p-2 mb-1 gap-2"
|
||||
@@ -138,7 +138,7 @@ function ChatList() {
|
||||
))}
|
||||
</div>
|
||||
) : isError ? (
|
||||
<div>Error</div>
|
||||
<div className="p-2">Error</div>
|
||||
) : (
|
||||
data.map((item) => (
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user