mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-09 07:28:36 +01:00
Compare commits
2 Commits
chore/i18n
...
fix/save-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
410b337bdc | ||
|
|
55d2b240e1 |
@@ -69,17 +69,23 @@ export const SaveAccountModal: React.FC<SaveAccountModalProps> = ({
|
||||
[isAndroid],
|
||||
);
|
||||
|
||||
const isPresentedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
bottomSheetModalRef.current?.present();
|
||||
} else {
|
||||
} else if (isPresentedRef.current) {
|
||||
bottomSheetModalRef.current?.dismiss();
|
||||
isPresentedRef.current = false;
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
const handleSheetChanges = useCallback(
|
||||
(index: number) => {
|
||||
if (index === -1) {
|
||||
if (index >= 0) {
|
||||
isPresentedRef.current = true;
|
||||
} else if (index === -1 && isPresentedRef.current) {
|
||||
isPresentedRef.current = false;
|
||||
resetState();
|
||||
onClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user