Commit f291484
authored
Fix: officer images and links (#240)
closes #235
Description:
On the Officers page, the app was crashing with "Administration for year 2026 not found" error, preventing the page from rendering. Additionally, external links were not displaying, and executive member photos were failing to load.
Root cause:
The currentAdministration computed property was hardcoded to look for executive administration data matching the current year (2026). Since the 2026 administration data doesn't exist yet in the codebase, the code threw an error instead of gracefully handling the missing data. Additionally, the toLocalUrl() method was looking for images in the executives/2026/ folder when they were actually in executives/2025/.
Fix:
Added fallback logic to use the most recent available administration when the current year's data doesn't exist. The code now uses .reduce() to find the administration with the highest startYear and displays that instead of crashing. Also built the image path inline using the actual administration's startYear instead of calling toLocalUrl(), ensuring images load from the correct year's folder (e.g., executives/2025/ when showing 2025 administration).1 parent 116d8e4 commit f291484
1 file changed
Lines changed: 4 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 49 | | |
0 commit comments