Use Closure::once instead of Closure::wrap
This commit is contained in:
parent
1d4d37b6ea
commit
f748fbf265
1 changed files with 5 additions and 7 deletions
|
@ -257,18 +257,16 @@ fn on_success(event: &Event, decrypted: &DecryptedData, expires: &str) {
|
|||
)
|
||||
.unwrap();
|
||||
put_action.set_onsuccess(Some(
|
||||
Closure::wrap(Box::new(|| {
|
||||
Closure::once(Box::new(|| {
|
||||
log!("success");
|
||||
load_from_db();
|
||||
}) as Box<dyn Fn()>)
|
||||
}))
|
||||
.into_js_value()
|
||||
.unchecked_ref(),
|
||||
));
|
||||
put_action.set_onerror(Some(
|
||||
Closure::wrap(Box::new(|e| {
|
||||
log!(e);
|
||||
}) as Box<dyn Fn(Event)>)
|
||||
.into_js_value()
|
||||
.unchecked_ref(),
|
||||
Closure::once(Box::new(|e: Event| log!(e)))
|
||||
.into_js_value()
|
||||
.unchecked_ref(),
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue