vmi-virtual-memorial/vmi-wd-frontend / 44c9250

Browse files

satisfy the linter

Authored by espadonne
SHA
44c9250403c5a29f0ab7d4de7b9e46b889289d80
Parents
36d48d2
Tree
c9bcc46

1 changed file

StatusFile+-
M app/memorial/page.tsx 6 4
app/memorial/page.tsxmodified
@@ -22,6 +22,7 @@ export default function MemorialIndexPage() {
2222
   const [error, setError] = useState<string | null>(null);
2323
   const [expandedConflicts, setExpandedConflicts] = useState<Set<number>>(new Set());
2424
   const [sortBy, setSortBy] = useState<'alphabetical' | 'class_year'>('alphabetical');
25
+  const [isInitialLoad, setIsInitialLoad] = useState(true);
2526
 
2627
   useEffect(() => {
2728
     async function fetchData() {
@@ -37,11 +38,12 @@ export default function MemorialIndexPage() {
3738
         setConflicts(data);
3839
 
3940
         // By default, expand conflicts with casualties (only on first load)
40
-        if (expandedConflicts.size === 0) {
41
+        if (isInitialLoad) {
4142
           const defaultExpanded = new Set<number>(
4243
             data.filter((c: ConflictWithCasualties) => c.casualty_count > 0).map((c: ConflictWithCasualties) => c.id)
4344
           );
4445
           setExpandedConflicts(defaultExpanded);
46
+          setIsInitialLoad(false);
4547
         }
4648
       } catch (err) {
4749
         setError(err instanceof Error ? err.message : 'Failed to load data');
@@ -52,7 +54,7 @@ export default function MemorialIndexPage() {
5254
     }
5355
 
5456
     fetchData();
55
-  }, [sortBy]);
57
+  }, [sortBy, isInitialLoad]);
5658
 
5759
   const toggleConflict = (conflictId: number) => {
5860
     const newExpanded = new Set(expandedConflicts);
@@ -157,7 +159,7 @@ export default function MemorialIndexPage() {
157159
                       : 'text-gray-500'
158160
                   }`}
159161
                 >
160
-                  '42
162
+                  &apos;42
161163
                 </span>
162164
               </button>
163165
             </div>
@@ -211,7 +213,7 @@ export default function MemorialIndexPage() {
211213
                             ? person.display_name.replace(person.rank + ' ', '').replace(person.rank + ', ', '')
212214
                             : person.display_name}
213215
                           {person.class_year && (
214
-                            <span className="text-gray-600 font-normal">'{String(person.class_year).slice(-2)}</span>
216
+                            <span className="text-gray-600 font-normal">&apos;{String(person.class_year).slice(-2)}</span>
215217
                           )}
216218
                           {person.pdf_key && <DocumentIcon className="flex-shrink-0" />}
217219
                         </h3>