add check for if new upload are allowed before opening uploadTypeSelector

This commit is contained in:
Abhinav 2023-02-21 18:44:12 +05:30
parent f6e9363e37
commit a0412263b1

View file

@ -105,6 +105,7 @@ import { User } from 'types/user';
import { getData, LS_KEYS } from 'utils/storage/localStorage';
import { CenteredFlex } from 'components/Container';
import { checkConnectivity } from 'utils/error/ui';
import uploadManager from 'services/upload/uploadManager';
export const DeadCenter = styled('div')`
flex: 1;
@ -567,6 +568,9 @@ export default function Gallery() {
};
const openUploader = (intent?: UploadTypeSelectorIntent) => {
if (!uploadManager.shouldAllowNewUpload()) {
return;
}
setUploadTypeSelectorView(true);
setUploadTypeSelectorIntent(intent);
};