Skip to content

Commit 3b9ef50

Browse files
committed
fix: erase downloads & mls data at logout
Leave no trace!
1 parent b1733e8 commit 3b9ef50

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src-tauri/src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,26 @@ async fn logout<R: Runtime>(handle: AppHandle<R>) {
28092809
// Erase the Database completely for a clean logout
28102810
db::nuke(handle.clone()).unwrap();
28112811

2812+
// Delete the downloads folder (vector folder in Downloads or Documents on iOS)
2813+
let base_directory = if cfg!(target_os = "ios") {
2814+
tauri::path::BaseDirectory::Document
2815+
} else {
2816+
tauri::path::BaseDirectory::Download
2817+
};
2818+
2819+
if let Ok(downloads_dir) = handle.path().resolve("vector", base_directory) {
2820+
if downloads_dir.exists() {
2821+
let _ = std::fs::remove_dir_all(&downloads_dir);
2822+
}
2823+
}
2824+
2825+
// Delete the MLS folder in AppData
2826+
if let Ok(mls_dir) = handle.path().resolve("mls", tauri::path::BaseDirectory::AppData) {
2827+
if mls_dir.exists() {
2828+
let _ = std::fs::remove_dir_all(&mls_dir);
2829+
}
2830+
}
2831+
28122832
// Restart the Core process
28132833
handle.restart();
28142834
}

src/js/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ domSettingsThemeSelect.onchange = (evt) => {
590590
// Listen for Logout clicks
591591
domSettingsLogout.onclick = async (evt) => {
592592
// Prompt for confirmation
593-
const fConfirm = await popupConfirm('Going Incognito?', 'Logging out of Vector will fully erase the database, <b>ensure you have a backup of your keys before logging out!</b><br><br>That said, would you like to continue?', false, '', 'vector_warning.svg');
593+
const fConfirm = await popupConfirm('Going Incognito?', 'Logging out of Vector will fully erase the database, <b>ensure you have a backup of your keys before logging out!</b><br><br><b>You will permanently lose access to your Group Chats after logging out!</b><br><br>That said, would you like to continue?', false, '', 'vector_warning.svg');
594594
if (!fConfirm) return;
595595

596596
// Begin the logout sequence

0 commit comments

Comments
 (0)