wrap promise response in set timeout to keep local state in sync (#2531)
This commit is contained in:
@@ -71,7 +71,7 @@ export const EditLogo: FC = () => {
|
|||||||
|
|
||||||
getBase64(file, (url: string) => {
|
getBase64(file, (url: string) => {
|
||||||
setlogoUrl(url);
|
setlogoUrl(url);
|
||||||
return res();
|
setTimeout(() => res(), 100);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -80,7 +80,6 @@ export const EditLogo: FC = () => {
|
|||||||
const handleLogoUpdate = async () => {
|
const handleLogoUpdate = async () => {
|
||||||
if (logoUrl !== currentLogo) {
|
if (logoUrl !== currentLogo) {
|
||||||
setSubmitStatus(createInputStatus(STATUS_PROCESSING));
|
setSubmitStatus(createInputStatus(STATUS_PROCESSING));
|
||||||
|
|
||||||
await postConfigUpdateToAPI({
|
await postConfigUpdateToAPI({
|
||||||
apiPath,
|
apiPath,
|
||||||
data: { value: logoUrl },
|
data: { value: logoUrl },
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { RcFile } from 'antd/lib/upload';
|
|
||||||
|
|
||||||
export const MAX_IMAGE_FILESIZE = 2097152;
|
export const MAX_IMAGE_FILESIZE = 2097152;
|
||||||
export const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
export const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user