fix: Disable S3 image loading and fix station detail data extraction
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
|
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
// CACHE_BUST: 2026-06-16-08-30-00
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
@@ -10,7 +11,7 @@ import { ChargingStationDetailCard } from '@lib/client/pages/charging-stations/d
|
|||||||
import { pageFlex, pageMargin } from '@lib/client/styles/page';
|
import { pageFlex, pageMargin } from '@lib/client/styles/page';
|
||||||
import { ChargingStationDetailTabsCard } from '@lib/client/pages/charging-stations/detail/charging.station.detail.tabs.card';
|
import { ChargingStationDetailTabsCard } from '@lib/client/pages/charging-stations/detail/charging.station.detail.tabs.card';
|
||||||
import { S3_BUCKET_FOLDER_IMAGES_CHARGING_STATIONS } from '@lib/utils/consts';
|
import { S3_BUCKET_FOLDER_IMAGES_CHARGING_STATIONS } from '@lib/utils/consts';
|
||||||
import { getPresignedUrlForGet } from '@lib/server/actions/file/getPresingedUrlForGet';
|
// import { getPresignedUrlForGet } from '@lib/server/actions/file/getPresingedUrlForGet';
|
||||||
import { AccessDeniedFallbackCard } from '@lib/client/components/access-denied-fallback-card';
|
import { AccessDeniedFallbackCard } from '@lib/client/components/access-denied-fallback-card';
|
||||||
import { Skeleton } from '@lib/client/components/ui/skeleton';
|
import { Skeleton } from '@lib/client/components/ui/skeleton';
|
||||||
|
|
||||||
@@ -21,16 +22,12 @@ type ChargingStationDetailProps = {
|
|||||||
export const ChargingStationDetail: React.FC<ChargingStationDetailProps> = ({ params }) => {
|
export const ChargingStationDetail: React.FC<ChargingStationDetailProps> = ({ params }) => {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
const [imageUrl, setImageUrl] = useState<string | null>(null);
|
const [imageUrl, setImageUrl] = useState<string | null>(null);
|
||||||
|
const [forceUpdate] = useState(Date.now()); // Force cache bust
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (id) {
|
// S3 image loading disabled - no bucket configured
|
||||||
getPresignedUrlForGet(`${S3_BUCKET_FOLDER_IMAGES_CHARGING_STATIONS}/${id}`).then((result) => {
|
void forceUpdate; // Used to force re-render
|
||||||
if (result.success) {
|
}, [id, forceUpdate]);
|
||||||
return setImageUrl(result.data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user