Load previous state in alt text modal (#546)

This commit is contained in:
Ollie Hsieh 2023-04-27 07:51:47 -07:00 committed by GitHub
parent c8e51a7d48
commit 7a2c21026d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View file

@ -15,7 +15,7 @@ export class ImageModel implements RNImage {
width: number
height: number
size: number
altText?: string = undefined
altText = ''
cropped?: RNImage = undefined
compressed?: RNImage = undefined
scaledWidth: number = POST_IMG_MAX.width
@ -45,7 +45,7 @@ export class ImageModel implements RNImage {
async setAltText() {
try {
const altText = await openAltTextModal(this.rootStore)
const altText = await openAltTextModal(this.rootStore, this.altText)
runInAction(() => {
this.altText = altText

View file

@ -43,6 +43,7 @@ export interface CropImageModal {
export interface AltTextImageModal {
name: 'alt-text-image'
prevAltText: string
onAltTextSet: (altText?: string) => void
}