Add more typings & refactor code accordingly

Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2020-09-03 15:46:18 +02:00
parent c6cd421f17
commit 2e3978b3c9

View File

@ -72,24 +72,24 @@ export function getImage(): SourceMetadata | undefined {
return store.getState().toJS().selection.image; return store.getState().toJS().selection.image;
} }
export function getImagePath() { export function getImagePath(): string | undefined {
return getImage()?.path; return store.getState().toJS().selection.image?.path;
} }
export function getImageSize() { export function getImageSize(): number | undefined {
return getImage()?.size; return store.getState().toJS().selection.image?.size;
} }
export function getImageName() { export function getImageName(): string | undefined {
return getImage()?.name; return store.getState().toJS().selection.image?.name;
} }
export function getImageLogo() { export function getImageLogo(): string | undefined {
return getImage()?.logo; return store.getState().toJS().selection.image?.logo;
} }
export function getImageSupportUrl() { export function getImageSupportUrl(): string | undefined {
return getImage()?.supportUrl; return store.getState().toJS().selection.image?.supportUrl;
} }
/** /**