fix: stream actions not working

Multiple sheets compete with each other and cause silent failure on ios.
This commit is contained in:
talksik
2026-04-30 16:53:48 -07:00
parent 6832c273cd
commit a6a4757a8e
2 changed files with 40 additions and 4 deletions
@@ -1,3 +1,4 @@
import { useState } from "react";
import { Pressable, Text, View } from "react-native";
import {
CircleCheckBig,
@@ -33,13 +34,28 @@ export function StreamActionsSheet({
isCreator,
canDeleteParticle,
}: StreamActionsSheetProps) {
// Hold the picked action until the sheet's Modal has fully unmounted, then
// dispatch. Follow-ups like rename/members open another Modal and "delete
// particle" shows an Alert — both are iOS Modals, and iOS will not present
// a second Modal while another is still on screen. Without this defer, the
// tap appears to do nothing and the app feels frozen behind a phantom
// overlay until the close animation finishes.
const [pending, setPending] = useState<StreamActionId | null>(null);
const choose = (id: StreamActionId) => {
setPending(id);
onClose();
onSelect(id);
};
const handleClosed = () => {
if (pending) {
onSelect(pending);
setPending(null);
}
};
return (
<BottomSheet open={open} onClose={onClose}>
<BottomSheet open={open} onClose={onClose} onClosed={handleClosed}>
<View className="py-2">
<ActionRow
icon={