Fixed bug with bad initial loading into store instead of auth

This commit is contained in:
quexeky
2024-10-17 21:14:10 +11:00
parent bf46dec359
commit 3923acf780
3 changed files with 8 additions and 6 deletions

View File

@ -41,9 +41,12 @@ pub struct Database {
pub base_url: String,
pub games: DatabaseGames,
}
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
pub type DatabaseInterface =
rustbreak::Database<Database, rustbreak::backend::PathBackend, Bincode>;
pub trait DatabaseImpls {
fn set_up_database() -> DatabaseInterface;
fn database_is_set_up(&self) -> bool;
@ -82,6 +85,4 @@ impl DatabaseImpls for DatabaseInterface {
let handle = self.borrow_data().unwrap();
Url::parse(&handle.base_url).unwrap()
}
}
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
}