Remove last 'outdated' references

This commit is contained in:
Sam Becker 2025-04-20 17:06:39 -05:00
parent fde890ed17
commit 6910ccbbcd
3 changed files with 11 additions and 9 deletions

View File

@ -23,7 +23,7 @@ export default async function AdminPhotosPage() {
const [
photos,
photosCount,
photosCountOutdated,
photosCountNeedsSync,
blobPhotoUrls,
] = await Promise.all([
getPhotos({
@ -45,7 +45,7 @@ export default async function AdminPhotosPage() {
<AdminPhotosClient {...{
photos,
photosCount,
photosCountOutdated,
photosCountNeedsSync,
shouldResize: !PRESERVE_ORIGINAL_UPLOADS,
hasAiTextGeneration: AI_TEXT_GENERATION_ENABLED,
onLastUpload: async () => {

View File

@ -18,7 +18,7 @@ import IconBroom from '@/components/icons/IconBroom';
export default function AdminPhotosClient({
photos,
photosCount,
photosCountOutdated,
photosCountNeedsSync,
blobPhotoUrls,
shouldResize,
hasAiTextGeneration,
@ -29,7 +29,7 @@ export default function AdminPhotosClient({
}: {
photos: Photo[]
photosCount: number
photosCountOutdated: number
photosCountNeedsSync: number
blobPhotoUrls: StorageListResponse
shouldResize: boolean
hasAiTextGeneration: boolean
@ -52,7 +52,7 @@ export default function AdminPhotosClient({
onLastUpload={onLastUpload}
/>
</div>
{photosCountOutdated > 0 &&
{photosCountNeedsSync > 0 &&
<PathLoaderButton
path={PATH_ADMIN_PHOTOS_SYNC}
icon={<IconBroom
@ -60,7 +60,7 @@ export default function AdminPhotosClient({
className="translate-y-[-1px]"
/>}
tooltip={(
pluralize(photosCountOutdated, 'photo') +
pluralize(photosCountNeedsSync, 'photo') +
' needs sync'
)}
className={clsx(
@ -74,7 +74,7 @@ export default function AdminPhotosClient({
spinnerClassName="text-blue-200 dark:text-blue-600/40"
hideTextOnMobile={false}
>
{photosCountOutdated}
{photosCountNeedsSync}
</PathLoaderButton>}
</div>
{blobPhotoUrls.length > 0 &&

View File

@ -13,6 +13,7 @@ import ResponsiveText from '@/components/primitives/ResponsiveText';
import { LiaBroomSolid } from 'react-icons/lia';
import ProgressButton from '@/components/primitives/ProgressButton';
import ErrorNote from '@/components/ErrorNote';
import { pluralize } from '@/utility/string';
const SYNC_BATCH_SIZE_MAX = 3;
@ -48,12 +49,13 @@ export default function AdminPhotosSyncClient({
icon={<IconGrSync className="translate-y-[1px]" />}
hideTextOnMobile={false}
progress={progress}
tooltip={`Sync data for all ${pluralize(photos.length, 'photo')}`}
onClick={async () => {
if (window.confirm([
'Are you sure you want to sync',
photos.length === 1
? '1 outdated photo?'
: `all ${photos.length} outdated photos?`,
? '1 photo?'
: `all ${photos.length} photos?`,
'Browser must remain open while syncing.',
'This action cannot be undone.',
].join(' '))) {