Skip to content

Commit

Permalink
fix: migrate old versions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
edfloreshz committed Jun 30, 2024
1 parent 4eda3b7 commit e77cb5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e77cb5c

Please sign in to comment.