wrap promise response in set timeout to keep local state in sync (#2531)

This commit is contained in:
André Rusakow 2022-12-29 22:19:23 +01:00 committed by GitHub
parent e7066f02ec
commit 15533d3d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -71,7 +71,7 @@ export const EditLogo: FC = () => {
getBase64(file, (url: string) => {
setlogoUrl(url);
return res();
setTimeout(() => res(), 100);
});
});
};
@ -80,7 +80,6 @@ export const EditLogo: FC = () => {
const handleLogoUpdate = async () => {
if (logoUrl !== currentLogo) {
setSubmitStatus(createInputStatus(STATUS_PROCESSING));
await postConfigUpdateToAPI({
apiPath,
data: { value: logoUrl },

View File

@ -1,5 +1,3 @@
import { RcFile } from 'antd/lib/upload';
export const MAX_IMAGE_FILESIZE = 2097152;
export const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];