fix: ui fixes
This commit is contained in:
@@ -37,12 +37,17 @@ type Status = "idle" | "saving" | "saved" | "auth" | "limit" | "error";
|
||||
export function CollectionsDrawer({
|
||||
open,
|
||||
onClose,
|
||||
onSaved,
|
||||
isMobile,
|
||||
selectedText,
|
||||
existingPostId,
|
||||
}: {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
/** Called instead of onClose after a successful save. Lets the selection
|
||||
* toolbar end the flow (drop the selection) rather than restore it the
|
||||
* way a cancel/dismiss does. Falls back to onClose when omitted. */
|
||||
onSaved?: () => void;
|
||||
isMobile: boolean;
|
||||
/** Provided by the selection toolbar — the drawer will create a fresh
|
||||
* post from this text before adding it to a collection. */
|
||||
@@ -150,7 +155,9 @@ export function CollectionsDrawer({
|
||||
c.id === collectionID ? { ...c, item_count: c.item_count + 1 } : c,
|
||||
),
|
||||
);
|
||||
setTimeout(onClose, 800);
|
||||
// Leave the "Saved ✓" row state visible for a beat, then complete the
|
||||
// flow — onSaved (don't restore the selection) when provided.
|
||||
setTimeout(onSaved ?? onClose, 800);
|
||||
} catch (err) {
|
||||
if (err instanceof SocialError) {
|
||||
const tone: Status =
|
||||
|
||||
Reference in New Issue
Block a user