wu981526092 commited on
Commit
458b783
·
1 Parent(s): 48b8905

Fix TypeScript build error in PrivacyNoticeModal - ensure all code paths return value

Browse files
frontend/src/components/layout/MainWorkspace.tsx CHANGED
@@ -330,7 +330,7 @@ export function MainWorkspace({
330
  <div className="fixed inset-0 bg-background z-50 flex flex-col">
331
  {/* Global Floating Action Widget for temporal view */}
332
  <FloatingActionWidget />
333
-
334
  {/* Privacy Notice Modal */}
335
  <PrivacyNoticeModal />
336
 
 
330
  <div className="fixed inset-0 bg-background z-50 flex flex-col">
331
  {/* Global Floating Action Widget for temporal view */}
332
  <FloatingActionWidget />
333
+
334
  {/* Privacy Notice Modal */}
335
  <PrivacyNoticeModal />
336
 
frontend/src/components/shared/modals/PrivacyNoticeModal.tsx CHANGED
@@ -18,16 +18,17 @@ export function PrivacyNoticeModal() {
18
 
19
  useEffect(() => {
20
  // Only show on HF Spaces and if not seen before
21
- if (IS_HF_SPACES) {
22
- const hasSeenNotice = localStorage.getItem(PRIVACY_NOTICE_KEY);
23
- if (!hasSeenNotice) {
24
- // Show modal after a short delay to ensure the app is loaded
25
- const timer = setTimeout(() => {
26
- setIsOpen(true);
27
- }, 1000);
28
- return () => clearTimeout(timer);
29
- }
30
- }
 
31
  }, []);
32
 
33
  const handleAccept = () => {
@@ -57,42 +58,46 @@ export function PrivacyNoticeModal() {
57
  <div className="flex items-start gap-3">
58
  <Database className="h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0" />
59
  <div className="text-sm">
60
- <strong>Temporary Data Storage:</strong> Your data is stored in a private, temporary session that is automatically cleared when the container restarts.
 
 
61
  </div>
62
  </div>
63
-
64
  <div className="flex items-start gap-3">
65
  <Shield className="h-4 w-4 text-green-600 mt-0.5 flex-shrink-0" />
66
  <div className="text-sm">
67
- <strong>Complete Privacy:</strong> Your traces and analysis results are not shared between users or sessions. Each user has their own isolated environment.
 
 
68
  </div>
69
  </div>
70
-
71
  <div className="flex items-start gap-3">
72
  <RefreshCw className="h-4 w-4 text-blue-600 mt-0.5 flex-shrink-0" />
73
  <div className="text-sm">
74
- <strong>Data Lifecycle:</strong> All uploaded traces, knowledge graphs, and analysis results will be permanently deleted when the Hugging Face Spaces container restarts.
 
 
75
  </div>
76
  </div>
77
-
78
  <div className="flex items-start gap-3">
79
  <Info className="h-4 w-4 text-gray-600 mt-0.5 flex-shrink-0" />
80
  <div className="text-sm">
81
- <strong>Recommendation:</strong> For persistent data storage and analysis, consider running AgentGraph locally or on your own infrastructure.
 
 
82
  </div>
83
  </div>
84
  </DialogDescription>
85
  </DialogHeader>
86
-
87
  <DialogFooter className="flex gap-2 sm:gap-2">
88
- <Button
89
- variant="outline"
90
- onClick={handleDismiss}
91
- className="flex-1"
92
- >
93
  Remind Me Later
94
  </Button>
95
- <Button
96
  onClick={handleAccept}
97
  className="flex-1 bg-blue-600 hover:bg-blue-700"
98
  >
 
18
 
19
  useEffect(() => {
20
  // Only show on HF Spaces and if not seen before
21
+ if (!IS_HF_SPACES) return;
22
+
23
+ const hasSeenNotice = localStorage.getItem(PRIVACY_NOTICE_KEY);
24
+ if (hasSeenNotice) return;
25
+
26
+ // Show modal after a short delay to ensure the app is loaded
27
+ const timer = setTimeout(() => {
28
+ setIsOpen(true);
29
+ }, 1000);
30
+
31
+ return () => clearTimeout(timer);
32
  }, []);
33
 
34
  const handleAccept = () => {
 
58
  <div className="flex items-start gap-3">
59
  <Database className="h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0" />
60
  <div className="text-sm">
61
+ <strong>Temporary Data Storage:</strong> Your data is stored in
62
+ a private, temporary session that is automatically cleared when
63
+ the container restarts.
64
  </div>
65
  </div>
66
+
67
  <div className="flex items-start gap-3">
68
  <Shield className="h-4 w-4 text-green-600 mt-0.5 flex-shrink-0" />
69
  <div className="text-sm">
70
+ <strong>Complete Privacy:</strong> Your traces and analysis
71
+ results are not shared between users or sessions. Each user has
72
+ their own isolated environment.
73
  </div>
74
  </div>
75
+
76
  <div className="flex items-start gap-3">
77
  <RefreshCw className="h-4 w-4 text-blue-600 mt-0.5 flex-shrink-0" />
78
  <div className="text-sm">
79
+ <strong>Data Lifecycle:</strong> All uploaded traces, knowledge
80
+ graphs, and analysis results will be permanently deleted when
81
+ the Hugging Face Spaces container restarts.
82
  </div>
83
  </div>
84
+
85
  <div className="flex items-start gap-3">
86
  <Info className="h-4 w-4 text-gray-600 mt-0.5 flex-shrink-0" />
87
  <div className="text-sm">
88
+ <strong>Recommendation:</strong> For persistent data storage and
89
+ analysis, consider running AgentGraph locally or on your own
90
+ infrastructure.
91
  </div>
92
  </div>
93
  </DialogDescription>
94
  </DialogHeader>
95
+
96
  <DialogFooter className="flex gap-2 sm:gap-2">
97
+ <Button variant="outline" onClick={handleDismiss} className="flex-1">
 
 
 
 
98
  Remind Me Later
99
  </Button>
100
+ <Button
101
  onClick={handleAccept}
102
  className="flex-1 bg-blue-600 hover:bg-blue-700"
103
  >