mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-17 02:01:14 +10:00
feat(library ui): add installed ui in the library menu
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
|
||||
use crate::{
|
||||
db::{GameStatus, GameTransientStatus},
|
||||
db::{Database, GameStatus, GameTransientStatus},
|
||||
DB,
|
||||
};
|
||||
|
||||
@ -10,9 +9,14 @@ pub struct GameStatusManager {}
|
||||
impl GameStatusManager {
|
||||
pub fn fetch_state(game_id: &String) -> GameStatusWithTransient {
|
||||
let db_lock = DB.borrow_data().unwrap();
|
||||
GameStatusManager::fetch_state_with_db(game_id, &db_lock)
|
||||
}
|
||||
pub fn fetch_state_with_db(
|
||||
game_id: &String,
|
||||
db_lock: &Database,
|
||||
) -> GameStatusWithTransient {
|
||||
let offline_state = db_lock.games.statuses.get(game_id).cloned();
|
||||
let online_state = db_lock.games.transient_statuses.get(game_id).cloned();
|
||||
drop(db_lock);
|
||||
|
||||
if online_state.is_some() {
|
||||
return (None, online_state);
|
||||
|
||||
Reference in New Issue
Block a user