don't re-hide when a request comes in while showing approval screen
This commit is contained in:
parent
e0c4c849dc
commit
fd60899f16
@ -67,12 +67,13 @@ impl Handler {
|
|||||||
// only hide the window if a) it was hidden to start with
|
// only hide the window if a) it was hidden to start with
|
||||||
// and b) there are no other pending requests
|
// and b) there are no other pending requests
|
||||||
let state = self.app.state::<AppState>();
|
let state = self.app.state::<AppState>();
|
||||||
|
let delay = {
|
||||||
|
let config = state.config.read().unwrap();
|
||||||
|
Duration::from_millis(config.rehide_ms)
|
||||||
|
};
|
||||||
|
sleep(delay).await;
|
||||||
|
|
||||||
if !starting_visibility && state.req_count() == 0 {
|
if !starting_visibility && state.req_count() == 0 {
|
||||||
let delay = {
|
|
||||||
let config = state.config.read().unwrap();
|
|
||||||
Duration::from_millis(config.rehide_ms)
|
|
||||||
};
|
|
||||||
sleep(delay).await;
|
|
||||||
let window = self.app.get_window("main").ok_or(RequestError::NoMainWindow)?;
|
let window = self.app.get_window("main").ok_or(RequestError::NoMainWindow)?;
|
||||||
window.hide()?;
|
window.hide()?;
|
||||||
}
|
}
|
||||||
|
8
src/lib/errors.js
Normal file
8
src/lib/errors.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export function getRootCause(error) {
|
||||||
|
if (error.source) {
|
||||||
|
return getRootCause(error.source);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user