die tenant admin oauth authentifizierung wurde implementiert und funktioniert jetzt. Zudem wurde das marketing frontend dashboard implementiert.
This commit is contained in:
@@ -283,7 +283,6 @@ const [canUpload, setCanUpload] = useState(true);
|
||||
|
||||
let canUploadCurrent = pkg.limits?.can_upload_photos ?? true;
|
||||
let errorMessage: string | null = null;
|
||||
const warnings: string[] = [];
|
||||
|
||||
if (photoLimits?.state === 'limit_reached') {
|
||||
canUploadCurrent = false;
|
||||
@@ -294,32 +293,16 @@ const [canUpload, setCanUpload] = useState(true);
|
||||
} else {
|
||||
errorMessage = t('upload.errors.photoLimit');
|
||||
}
|
||||
} else if (
|
||||
photoLimits?.state === 'warning'
|
||||
&& typeof photoLimits.remaining === 'number'
|
||||
&& typeof photoLimits.limit === 'number'
|
||||
) {
|
||||
warnings.push(
|
||||
t('upload.limitWarning')
|
||||
.replace('{remaining}', `${photoLimits.remaining}`)
|
||||
.replace('{max}', `${photoLimits.limit}`)
|
||||
);
|
||||
}
|
||||
|
||||
if (galleryLimits?.state === 'expired') {
|
||||
canUploadCurrent = false;
|
||||
errorMessage = t('upload.errors.galleryExpired');
|
||||
} else if (galleryLimits?.state === 'warning') {
|
||||
const daysLeft = Math.max(0, galleryLimits.days_remaining ?? 0);
|
||||
const key = daysLeft === 1 ? 'upload.galleryWarningDay' : 'upload.galleryWarningDays';
|
||||
warnings.push(
|
||||
t(key).replace('{days}', `${daysLeft}`)
|
||||
);
|
||||
}
|
||||
|
||||
setCanUpload(canUploadCurrent);
|
||||
setUploadError(errorMessage);
|
||||
setUploadWarning(errorMessage ? null : (warnings.length > 0 ? warnings.join(' · ') : null));
|
||||
setUploadWarning(null);
|
||||
} catch (err) {
|
||||
console.error('Failed to check package limits', err);
|
||||
setCanUpload(false);
|
||||
|
||||
Reference in New Issue
Block a user