mirror of https://codeberg.org/topola/topola.git
fix(interactor): reliably, properly stop activity
This commit is contained in:
parent
92e8600452
commit
c2bdeb61e4
|
|
@ -60,7 +60,7 @@ impl<M: AccessMesadata> Interactor<M> {
|
||||||
|
|
||||||
/// Abort the currently running execution or activity
|
/// Abort the currently running execution or activity
|
||||||
pub fn abort(&mut self) {
|
pub fn abort(&mut self) {
|
||||||
if let Some(ref mut activity) = self.activity {
|
if let Some(ref mut activity) = self.activity.take() {
|
||||||
activity.abort(&mut ActivityContext::<M> {
|
activity.abort(&mut ActivityContext::<M> {
|
||||||
interactive_input: &InteractiveInput {
|
interactive_input: &InteractiveInput {
|
||||||
pointer_pos: [0.0, 0.0].into(),
|
pointer_pos: [0.0, 0.0].into(),
|
||||||
|
|
@ -87,7 +87,10 @@ impl<M: AccessMesadata> Interactor<M> {
|
||||||
invoker: &mut self.invoker,
|
invoker: &mut self.invoker,
|
||||||
}) {
|
}) {
|
||||||
Ok(ControlFlow::Continue(())) => ControlFlow::Continue(()),
|
Ok(ControlFlow::Continue(())) => ControlFlow::Continue(()),
|
||||||
Ok(ControlFlow::Break(_msg)) => ControlFlow::Break(Ok(())),
|
Ok(ControlFlow::Break(_msg)) => {
|
||||||
|
self.activity = None;
|
||||||
|
ControlFlow::Break(Ok(()))
|
||||||
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
self.activity = None;
|
self.activity = None;
|
||||||
ControlFlow::Break(Err(err))
|
ControlFlow::Break(Err(err))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue