many bug fixes + add links and collections together + more changes

This commit is contained in:
daniel31x13
2023-12-01 16:29:17 -05:00
parent a3c6d9b42e
commit a36769c521
27 changed files with 169 additions and 190 deletions
@@ -31,6 +31,16 @@ export default function EditCollectionSharingModal({
const modal = document.getElementById(modalId);
useEffect(() => {
const fetchOwner = async () => {
const owner = await getPublicUserData(collection.ownerId as number);
setCollectionOwner(owner);
};
fetchOwner();
modal?.scrollTo(0, 0);
setCollection(activeCollection);
modal?.addEventListener("close", () => {
onClose();
});
@@ -45,10 +55,6 @@ export default function EditCollectionSharingModal({
const [collection, setCollection] =
useState<CollectionIncludingMembersAndLinkCount>(activeCollection);
useEffect(() => {
setCollection(activeCollection);
}, [isOpen]);
const [submitLoader, setSubmitLoader] = useState(false);
const { updateCollection } = useCollectionStore();
@@ -92,15 +98,6 @@ export default function EditCollectionSharingModal({
image: "",
});
useEffect(() => {
const fetchOwner = async () => {
const owner = await getPublicUserData(collection.ownerId as number);
setCollectionOwner(owner);
};
fetchOwner();
}, []);
const setMemberState = (newMember: Member) => {
if (!collection) return null;
@@ -115,7 +112,7 @@ export default function EditCollectionSharingModal({
return (
<dialog
id={modalId}
className="modal backdrop-blur-sm overflow-y-auto"
className="modal backdrop-blur-sm overflow-y-auto p-5"
open={isOpen}
>
<Toaster