From e77cb5c4e6d81c2a8dfe6b09b3983e12c6535070 Mon Sep 17 00:00:00 2001 From: Eduardo Flores Date: Sat, 29 Jun 2024 20:54:53 -0700 Subject: [PATCH] fix: migrate old versions correctly --- src/app/settings.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/settings.rs b/src/app/settings.rs index 30370e7..fae31be 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -13,7 +13,8 @@ pub fn init() -> (Settings, Flags) { set_localization(); set_icon_cache(); set_logger(); - migrate(); + migrate("com.system76.CosmicTasks"); + migrate("dev.edfloreshz.Orderly"); let settings = get_app_settings(); let flags = get_flags(); (settings, flags) @@ -48,9 +49,8 @@ pub fn get_flags() -> Flags { flags } -pub fn migrate() { - const PREV_APP_ID: &str = "dev.edfloreshz.Orderly"; - let prev = dirs::data_local_dir().unwrap().join(PREV_APP_ID); +pub fn migrate(prev_app_id: &str) { + let prev = dirs::data_local_dir().unwrap().join(prev_app_id); let new = dirs::data_local_dir().unwrap().join(Tasks::APP_ID); if prev.exists() { match std::fs::rename(prev, new) {