Commit e521c36e authored by Mart Lubbers's avatar Mart Lubbers

Fix workAs in case of a destroy or never stabilizing task

parent c8aefa3d
......@@ -218,13 +218,10 @@ where
*/
workAs :: !User !(Task a) -> Task a | iTask a
workAs asUser task
= get currentUser
>>- \prevUser ->
set asUser currentUser
>>| ((task
>>- \tvalue -> //TODO: What if the wrapped task never becomes stable? And what if the composition is terminated early because of a step?
set prevUser currentUser
@! tvalue) <<@ ApplyLayout unwrapUI)
= get currentUser
>>- \prevUser->set asUser currentUser
>>| withCleanupHook (set prevUser currentUser) task
<<@ ApplyLayout unwrapUI
/*
* When a task is assigned to a user a synchronous task instance process is created.
* It is created once and loaded and evaluated on later runs.
......
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