You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ui_src/src/views/user-scope.tsx
+61Lines changed: 61 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ export default function UserScope() {
14
14
const[error,setError]=useState<string>();
15
15
const[loading,setLoading]=useState(true);
16
16
const[filesPage,setFilesPage]=useState(0);
17
+
const[purging,setPurging]=useState(false);
17
18
18
19
constlogin=useLogin();
19
20
constpub=usePublisher();
@@ -54,6 +55,44 @@ export default function UserScope() {
54
55
}
55
56
},[pub,self?.is_admin,pubkey,filesPage,url]);
56
57
58
+
asyncfunctionhandlePurgeUser(){
59
+
if(!pub||!pubkey)return;
60
+
61
+
constconfirmed=window.confirm(
62
+
`Are you sure you want to delete ALL files for this user?\n\nThis action cannot be undone and will permanently delete:\n- ${userInfo?.file_count||0} files\n- ${FormatBytes(userInfo?.total_size||0,2)} of storage\n\nType "DELETE" to confirm.`
63
+
);
64
+
65
+
if(!confirmed)return;
66
+
67
+
constconfirmText=window.prompt(
68
+
'Please type "DELETE" to confirm this destructive action:'
69
+
);
70
+
71
+
if(confirmText!=="DELETE"){
72
+
alert("Confirmation text did not match. Operation cancelled.");
0 commit comments