mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-19 11:11:18 +10:00
feat(database): Ensure that any database issues are resolved by standalone functions
Functions are as follows: - save_db() - borrow_db_checked() - borrow_db_mut_checked()
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
database::db::{ApplicationTransientStatus, GameDownloadStatus},
|
||||
database::db::{borrow_db_checked, ApplicationTransientStatus, GameDownloadStatus},
|
||||
DB,
|
||||
};
|
||||
|
||||
@ -11,7 +11,7 @@ pub struct GameStatusManager {}
|
||||
|
||||
impl GameStatusManager {
|
||||
pub fn fetch_state(game_id: &String) -> GameStatusWithTransient {
|
||||
let db_lock = DB.borrow_data().unwrap();
|
||||
let db_lock = borrow_db_checked();
|
||||
let online_state = match db_lock.applications.installed_game_version.get(game_id) {
|
||||
Some(meta) => db_lock.applications.transient_statuses.get(meta).cloned(),
|
||||
None => None,
|
||||
|
||||
Reference in New Issue
Block a user