larxius commited on
Commit
0062aef
·
verified ·
1 Parent(s): 73048ec

Update frontend/src/components/ErrorBoundary.jsx

Browse files
frontend/src/components/ErrorBoundary.jsx CHANGED
@@ -46,16 +46,37 @@ export class ErrorBoundary extends React.Component {
46
  <span className="material-symbols-outlined text-2xl">refresh</span>
47
  </div>
48
  <h2 className="text-xl font-bold text-slate-900 mb-2">Session Navigation Update</h2>
49
- <p className="text-sm text-slate-500 mb-6 leading-relaxed">
50
- The page view encountered a sync issue or session timeout. Refresh the page or return to log in.
51
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  <div className="flex flex-col gap-3">
53
  <button
54
  onClick={() => {
55
  this.setState({ hasError: false, error: null });
56
- window.location.reload();
57
  }}
58
  className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-xl transition-all shadow-md shadow-blue-600/20 border-0 cursor-pointer text-sm"
 
 
 
 
 
 
 
 
 
59
  >
60
  Refresh Page
61
  </button>
@@ -66,9 +87,9 @@ export class ErrorBoundary extends React.Component {
66
  localStorage.removeItem('wss_refresh_token');
67
  window.location.href = '/login';
68
  }}
69
- className="w-full bg-slate-100 hover:bg-slate-200 text-slate-700 font-semibold py-2.5 px-6 rounded-xl transition-all border-0 cursor-pointer text-sm"
70
  >
71
- Clear Session & Log In Again
72
  </button>
73
  </div>
74
  </div>
 
46
  <span className="material-symbols-outlined text-2xl">refresh</span>
47
  </div>
48
  <h2 className="text-xl font-bold text-slate-900 mb-2">Session Navigation Update</h2>
49
+ <p className="text-sm text-slate-500 mb-4 leading-relaxed">
50
+ The page view encountered a sync issue or session timeout.
51
  </p>
52
+
53
+ {this.state.error?.message && (
54
+ <div className="mb-5 p-3 bg-red-50 border border-red-200 rounded-xl text-left">
55
+ <div className="text-xs font-bold text-red-800 mb-1 flex items-center gap-1">
56
+ <span className="material-symbols-outlined text-[14px]">error</span>
57
+ System Notice:
58
+ </div>
59
+ <p className="text-xs font-mono text-red-700 break-words leading-relaxed max-h-24 overflow-y-auto">
60
+ {this.state.error.message}
61
+ </p>
62
+ </div>
63
+ )}
64
+
65
  <div className="flex flex-col gap-3">
66
  <button
67
  onClick={() => {
68
  this.setState({ hasError: false, error: null });
 
69
  }}
70
  className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-xl transition-all shadow-md shadow-blue-600/20 border-0 cursor-pointer text-sm"
71
+ >
72
+ Resume Current View
73
+ </button>
74
+ <button
75
+ onClick={() => {
76
+ this.setState({ hasError: false, error: null });
77
+ window.location.reload();
78
+ }}
79
+ className="w-full bg-slate-100 hover:bg-slate-200 text-slate-700 font-semibold py-2.5 px-6 rounded-xl transition-all border-0 cursor-pointer text-sm"
80
  >
81
  Refresh Page
82
  </button>
 
87
  localStorage.removeItem('wss_refresh_token');
88
  window.location.href = '/login';
89
  }}
90
+ className="w-full text-slate-500 hover:text-slate-700 text-xs font-medium py-1 transition-all border-0 bg-transparent cursor-pointer"
91
  >
92
+ Clear Session & Return to Login
93
  </button>
94
  </div>
95
  </div>