larxius commited on
Commit
a854339
·
verified ·
1 Parent(s): 2b80190

Update frontend/src/pages/Profile.jsx

Browse files
Files changed (1) hide show
  1. frontend/src/pages/Profile.jsx +17 -1
frontend/src/pages/Profile.jsx CHANGED
@@ -686,7 +686,23 @@ export const Profile = () => {
686
 
687
  {reportLogoUrl && (
688
  <div className="mb-6 p-4 bg-white rounded-xl border border-[#e5e7eb] shadow-xs flex items-center justify-center max-w-sm w-full pointer-events-auto">
689
- <img src={reportLogoUrl} alt="Organization Logo" className="max-h-24 max-w-full object-contain" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  </div>
691
  )}
692
 
 
686
 
687
  {reportLogoUrl && (
688
  <div className="mb-6 p-4 bg-white rounded-xl border border-[#e5e7eb] shadow-xs flex items-center justify-center max-w-sm w-full pointer-events-auto">
689
+ <img
690
+ src={reportLogoUrl}
691
+ alt="Organization Logo"
692
+ className="max-h-24 max-w-full object-contain"
693
+ onError={(e) => {
694
+ if (reportLogoUrl && !e.target.dataset.retried) {
695
+ e.target.dataset.retried = '1';
696
+ if (reportLogoUrl.startsWith('/uploads/')) {
697
+ e.target.src = `/api/auth${reportLogoUrl}`;
698
+ } else if (reportLogoUrl.startsWith('/api/auth/uploads/')) {
699
+ e.target.src = reportLogoUrl.replace('/api/auth', '');
700
+ } else if (!reportLogoUrl.startsWith('http')) {
701
+ e.target.src = `/uploads/logos/${reportLogoUrl.split('/').pop()}`;
702
+ }
703
+ }
704
+ }}
705
+ />
706
  </div>
707
  )}
708