Commit 6d5ca0d9 authored by Steffen Michels's avatar Steffen Michels

clear SDS registrations when interact task is destroyed

parent b8c197af
Pipeline #12326 passed with stage
in 3 minutes and 1 second
......@@ -10,7 +10,7 @@ import iTasks.Internal.TaskEval
import iTasks.Internal.IWorld
import qualified iTasks.Internal.SDS as SDS
import Data.Error, Data.Maybe
import Data.Error, Data.Maybe, Data.Func
import Text.GenJSON
import StdString, StdBool
import qualified Data.Set as DS
......@@ -56,11 +56,13 @@ where
interact :: !d !EditMode !(SDS () r w) (InteractionHandlers l r w v) (Editor v) -> Task (l,v) | toPrompt d & iTask l & iTask r & iTask v & TC w
interact prompt mode shared {onInit,onEdit,onRefresh} editor = Task eval
eval event evalOpts (TCDestroy _) iworld = (DestroyedResult,iworld)
eval event evalOpts tt=:(TCDestroy _) iworld
# iworld = 'SDS'.clearTaskSDSRegistrations ('DS'.singleton $ fromOk $ taskIdFromTaskTree tt) iworld
= (DestroyedResult, iworld)
eval event evalOpts tree iworld=:{current={taskTime}}
//Decode or initialize state
# (mbd,iworld) = case tree of
# (mbd,iworld) = case tree of
(TCInit taskId ts)
= case 'SDS'.readRegister taskId shared iworld of
(Ok r,iworld)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment