mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
Merge pull request #230 from Yh010/bug/multiButtonPress
fixes #146 multiple memory submission bug
This commit is contained in:
commit
bfb0e86d76
1 changed files with 11 additions and 7 deletions
|
|
@ -31,10 +31,20 @@ import ComboboxWithCreate from "@repo/ui/shadcn/combobox";
|
|||
import { StoredSpace } from "@repo/db/schema";
|
||||
import useMeasure from "react-use-measure";
|
||||
import { useKeyPress } from "@/lib/useKeyPress";
|
||||
import { useFormStatus } from "react-dom";
|
||||
|
||||
function Menu() {
|
||||
const [spaces, setSpaces] = useState<StoredSpace[]>([]);
|
||||
|
||||
function SubmitButton() {
|
||||
const status = useFormStatus();
|
||||
return (
|
||||
<Button disabled={status.pending} variant={"secondary"} type="submit">
|
||||
Save {autoDetectedType != "none" && autoDetectedType}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
let spaces = await getSpaces();
|
||||
|
|
@ -319,13 +329,7 @@ function Menu() {
|
|||
</div>
|
||||
|
||||
<DialogFooter>
|
||||
<Button
|
||||
disabled={autoDetectedType === "none"}
|
||||
variant={"secondary"}
|
||||
type="submit"
|
||||
>
|
||||
Save {autoDetectedType != "none" && autoDetectedType}
|
||||
</Button>
|
||||
<SubmitButton />
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</DialogContent>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue