move space logic to zustand

This commit is contained in:
Ren Amamiya
2023-06-02 18:06:19 +07:00
parent dffe300a5f
commit 48e453fe5c
8 changed files with 126 additions and 42 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import { Fragment, useState } from "react";
import { useForm } from "react-hook-form";
export function AddFeedBlock({ parentState }: { parentState: any }) {
const account = useActiveAccount((state: any) => state.account);
const addBlock = useActiveAccount((state: any) => state.addBlock);
const [loading, setLoading] = useState(false);
const [isOpen, setIsOpen] = useState(true);
@@ -36,7 +36,7 @@ export function AddFeedBlock({ parentState }: { parentState: any }) {
}
// insert to database
createBlock(account.id, 1, data.title, pubkey);
addBlock(1, data.title, pubkey);
setTimeout(() => {
setLoading(false);