diff options
author | Ollie Hsieh <renahlee@outlook.com> | 2023-04-27 07:51:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 09:51:47 -0500 |
commit | 7a2c21026db702d028c20796a8d0bccd68de5464 (patch) | |
tree | b0f200338e646c186fefb545b3638ef5146d0845 /src/view/com/modals/AltImage.tsx | |
parent | c8e51a7d48587d977a7c005caeb9a1b215fa0ab5 (diff) | |
download | voidsky-7a2c21026db702d028c20796a8d0bccd68de5464.tar.zst |
Load previous state in alt text modal (#546)
Diffstat (limited to 'src/view/com/modals/AltImage.tsx')
-rw-r--r-- | src/view/com/modals/AltImage.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/view/com/modals/AltImage.tsx b/src/view/com/modals/AltImage.tsx index e6e2ed831..639303c98 100644 --- a/src/view/com/modals/AltImage.tsx +++ b/src/view/com/modals/AltImage.tsx @@ -15,14 +15,15 @@ import {isDesktopWeb} from 'platform/detection' export const snapPoints = ['80%'] interface Props { + prevAltText: string onAltTextSet: (altText?: string | undefined) => void } -export function Component({onAltTextSet}: Props) { +export function Component({prevAltText, onAltTextSet}: Props) { const pal = usePalette('default') const store = useStores() const theme = useTheme() - const [altText, setAltText] = useState('') + const [altText, setAltText] = useState(prevAltText) const onPressSave = useCallback(() => { onAltTextSet(altText) |