Pre-web image changes refactor (#560)
* Pre-web image changes refactor * Remove unneeded async behavior
This commit is contained in:
parent
74fbb47979
commit
bd80db619b
5 changed files with 22 additions and 35 deletions
|
@ -1,20 +1,12 @@
|
|||
import {RootStoreModel} from 'state/index'
|
||||
import {ImageModel} from 'state/models/media/image'
|
||||
|
||||
export async function openAltTextModal(
|
||||
store: RootStoreModel,
|
||||
prevAltText: string,
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
store.shell.openModal({
|
||||
name: 'alt-text-image',
|
||||
prevAltText,
|
||||
onAltTextSet: (altText?: string) => {
|
||||
if (altText) {
|
||||
resolve(altText)
|
||||
} else {
|
||||
reject(new Error('Canceled'))
|
||||
}
|
||||
},
|
||||
})
|
||||
image: ImageModel,
|
||||
) {
|
||||
store.shell.openModal({
|
||||
name: 'alt-text-image',
|
||||
image,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue