mirror of https://github.com/TaKO8Ki/gobang
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
520 B
Rust
17 lines
520 B
Rust
use crate::app::{App, Database};
|
|
use crate::event::Key;
|
|
use crate::utils::get_databases;
|
|
|
|
pub async fn handler(_key: Key, app: &mut App) -> anyhow::Result<()> {
|
|
app.databases = match app.selected_connection() {
|
|
Some(conn) => match &conn.database {
|
|
Some(database) => {
|
|
vec![Database::new(database.clone(), app.pool.as_ref().unwrap()).await?]
|
|
}
|
|
None => get_databases(app.pool.as_ref().unwrap()).await?,
|
|
},
|
|
None => vec![],
|
|
};
|
|
Ok(())
|
|
}
|