larxius commited on
Commit
d45b4a0
·
verified ·
1 Parent(s): 58b40d8

Update frontend/src/components/ErrorBoundary.jsx

Browse files
frontend/src/components/ErrorBoundary.jsx CHANGED
@@ -47,17 +47,30 @@ export class ErrorBoundary extends React.Component {
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 needs a quick refresh to synchronize your security session.
51
  </p>
52
- <button
53
- onClick={() => {
54
- this.setState({ hasError: false, error: null });
55
- window.location.reload();
56
- }}
57
- 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"
58
- >
59
- Refresh Page
60
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  </div>
62
  </div>
63
  );
 
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>
62
+ <button
63
+ onClick={() => {
64
+ sessionStorage.clear();
65
+ localStorage.removeItem('wss_token');
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>
75
  </div>
76
  );