From 7a2c21026db702d028c20796a8d0bccd68de5464 Mon Sep 17 00:00:00 2001
From: Ollie Hsieh <renahlee@outlook.com>
Date: Thu, 27 Apr 2023 07:51:47 -0700
Subject: Load previous state in alt text modal (#546)

---
 src/view/com/modals/AltImage.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/view/com/modals/AltImage.tsx')

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)
-- 
cgit 1.4.1

