don't autohide on first launch
This commit is contained in:
parent
486001b584
commit
60c24e3ee4
@ -74,13 +74,16 @@ pub async fn connect_db() -> Result<SqlitePool, SetupError> {
|
|||||||
async fn setup(app: &mut App) -> Result<(), Box<dyn Error>> {
|
async fn setup(app: &mut App) -> Result<(), Box<dyn Error>> {
|
||||||
APP.set(app.handle()).unwrap();
|
APP.set(app.handle()).unwrap();
|
||||||
|
|
||||||
|
let is_first_launch = config::get_or_create_db_path()?.exists();
|
||||||
|
|
||||||
let pool = connect_db().await?;
|
let pool = connect_db().await?;
|
||||||
let conf = AppConfig::load(&pool).await?;
|
let conf = AppConfig::load(&pool).await?;
|
||||||
let session = Session::load(&pool).await?;
|
let session = Session::load(&pool).await?;
|
||||||
let srv = Server::new(conf.listen_addr, conf.listen_port, app.handle()).await?;
|
let srv = Server::new(conf.listen_addr, conf.listen_port, app.handle()).await?;
|
||||||
|
|
||||||
config::set_auto_launch(conf.start_on_login)?;
|
config::set_auto_launch(conf.start_on_login)?;
|
||||||
if !conf.start_minimized {
|
// if session is empty, this is probably the first launch, so don't autohide
|
||||||
|
if !conf.start_minimized || is_first_launch {
|
||||||
app.get_window("main")
|
app.get_window("main")
|
||||||
.ok_or(HandlerError::NoMainWindow)?
|
.ok_or(HandlerError::NoMainWindow)?
|
||||||
.show()?;
|
.show()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user