Remove last 'outdated' references
This commit is contained in:
parent
fde890ed17
commit
6910ccbbcd
@ -23,7 +23,7 @@ export default async function AdminPhotosPage() {
|
|||||||
const [
|
const [
|
||||||
photos,
|
photos,
|
||||||
photosCount,
|
photosCount,
|
||||||
photosCountOutdated,
|
photosCountNeedsSync,
|
||||||
blobPhotoUrls,
|
blobPhotoUrls,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
getPhotos({
|
getPhotos({
|
||||||
@ -45,7 +45,7 @@ export default async function AdminPhotosPage() {
|
|||||||
<AdminPhotosClient {...{
|
<AdminPhotosClient {...{
|
||||||
photos,
|
photos,
|
||||||
photosCount,
|
photosCount,
|
||||||
photosCountOutdated,
|
photosCountNeedsSync,
|
||||||
shouldResize: !PRESERVE_ORIGINAL_UPLOADS,
|
shouldResize: !PRESERVE_ORIGINAL_UPLOADS,
|
||||||
hasAiTextGeneration: AI_TEXT_GENERATION_ENABLED,
|
hasAiTextGeneration: AI_TEXT_GENERATION_ENABLED,
|
||||||
onLastUpload: async () => {
|
onLastUpload: async () => {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import IconBroom from '@/components/icons/IconBroom';
|
|||||||
export default function AdminPhotosClient({
|
export default function AdminPhotosClient({
|
||||||
photos,
|
photos,
|
||||||
photosCount,
|
photosCount,
|
||||||
photosCountOutdated,
|
photosCountNeedsSync,
|
||||||
blobPhotoUrls,
|
blobPhotoUrls,
|
||||||
shouldResize,
|
shouldResize,
|
||||||
hasAiTextGeneration,
|
hasAiTextGeneration,
|
||||||
@ -29,7 +29,7 @@ export default function AdminPhotosClient({
|
|||||||
}: {
|
}: {
|
||||||
photos: Photo[]
|
photos: Photo[]
|
||||||
photosCount: number
|
photosCount: number
|
||||||
photosCountOutdated: number
|
photosCountNeedsSync: number
|
||||||
blobPhotoUrls: StorageListResponse
|
blobPhotoUrls: StorageListResponse
|
||||||
shouldResize: boolean
|
shouldResize: boolean
|
||||||
hasAiTextGeneration: boolean
|
hasAiTextGeneration: boolean
|
||||||
@ -52,7 +52,7 @@ export default function AdminPhotosClient({
|
|||||||
onLastUpload={onLastUpload}
|
onLastUpload={onLastUpload}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{photosCountOutdated > 0 &&
|
{photosCountNeedsSync > 0 &&
|
||||||
<PathLoaderButton
|
<PathLoaderButton
|
||||||
path={PATH_ADMIN_PHOTOS_SYNC}
|
path={PATH_ADMIN_PHOTOS_SYNC}
|
||||||
icon={<IconBroom
|
icon={<IconBroom
|
||||||
@ -60,7 +60,7 @@ export default function AdminPhotosClient({
|
|||||||
className="translate-y-[-1px]"
|
className="translate-y-[-1px]"
|
||||||
/>}
|
/>}
|
||||||
tooltip={(
|
tooltip={(
|
||||||
pluralize(photosCountOutdated, 'photo') +
|
pluralize(photosCountNeedsSync, 'photo') +
|
||||||
' needs sync'
|
' needs sync'
|
||||||
)}
|
)}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@ -74,7 +74,7 @@ export default function AdminPhotosClient({
|
|||||||
spinnerClassName="text-blue-200 dark:text-blue-600/40"
|
spinnerClassName="text-blue-200 dark:text-blue-600/40"
|
||||||
hideTextOnMobile={false}
|
hideTextOnMobile={false}
|
||||||
>
|
>
|
||||||
{photosCountOutdated}
|
{photosCountNeedsSync}
|
||||||
</PathLoaderButton>}
|
</PathLoaderButton>}
|
||||||
</div>
|
</div>
|
||||||
{blobPhotoUrls.length > 0 &&
|
{blobPhotoUrls.length > 0 &&
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import ResponsiveText from '@/components/primitives/ResponsiveText';
|
|||||||
import { LiaBroomSolid } from 'react-icons/lia';
|
import { LiaBroomSolid } from 'react-icons/lia';
|
||||||
import ProgressButton from '@/components/primitives/ProgressButton';
|
import ProgressButton from '@/components/primitives/ProgressButton';
|
||||||
import ErrorNote from '@/components/ErrorNote';
|
import ErrorNote from '@/components/ErrorNote';
|
||||||
|
import { pluralize } from '@/utility/string';
|
||||||
|
|
||||||
const SYNC_BATCH_SIZE_MAX = 3;
|
const SYNC_BATCH_SIZE_MAX = 3;
|
||||||
|
|
||||||
@ -48,12 +49,13 @@ export default function AdminPhotosSyncClient({
|
|||||||
icon={<IconGrSync className="translate-y-[1px]" />}
|
icon={<IconGrSync className="translate-y-[1px]" />}
|
||||||
hideTextOnMobile={false}
|
hideTextOnMobile={false}
|
||||||
progress={progress}
|
progress={progress}
|
||||||
|
tooltip={`Sync data for all ${pluralize(photos.length, 'photo')}`}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (window.confirm([
|
if (window.confirm([
|
||||||
'Are you sure you want to sync',
|
'Are you sure you want to sync',
|
||||||
photos.length === 1
|
photos.length === 1
|
||||||
? '1 outdated photo?'
|
? '1 photo?'
|
||||||
: `all ${photos.length} outdated photos?`,
|
: `all ${photos.length} photos?`,
|
||||||
'Browser must remain open while syncing.',
|
'Browser must remain open while syncing.',
|
||||||
'This action cannot be undone.',
|
'This action cannot be undone.',
|
||||||
].join(' '))) {
|
].join(' '))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user