Skip to content

Commit

Permalink
fix PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shmish111 committed Jan 14, 2021
1 parent f1790c9 commit 78ac31f
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions marlowe-playground-client/src/MainFrame/State.purs
Expand Up @@ -20,7 +20,6 @@ import Data.Lens.Index (ix)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Newtype (unwrap)
import Debug.Trace (spy)
import Demos.Types (Action(..), Demo(..)) as Demos
import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Class (class MonadEffect)
Expand Down Expand Up @@ -657,14 +656,24 @@ handleGistAction settings PublishGist = do
-- playground is a meta-data file that we currently just use as a tag to check if a gist is a marlowe playground gist
playground = "{}"
workflow <- use _workflow
marlowe <- if workflow /= Just Marlowe then pure Nothing else pruneEmpty <$> MarloweEditor.editorGetValue
blockly <- if workflow /= Just Blockly then pure Nothing else pruneEmpty <$> BlocklyEditor.editorGetValue
haskell <- if workflow /= Just Haskell then pure Nothing else pruneEmpty <$> HaskellEditor.editorGetValue
javascript <- if workflow /= Just Javascript then pure Nothing else pruneEmpty <$> (toJavascriptEditor JavascriptEditor.editorGetValue)
actus <- if workflow /= Just Actus then pure Nothing else pruneEmpty <$> query _actusBlocklySlot unit (H.request ActusBlockly.GetWorkspace)
files <- case workflow of
Just Marlowe -> do
marlowe <- pruneEmpty <$> MarloweEditor.editorGetValue
pure $ mempty { marlowe }
Just Blockly -> do
blockly <- pruneEmpty <$> BlocklyEditor.editorGetValue
pure $ mempty { blockly }
Just Haskell -> do
haskell <- pruneEmpty <$> HaskellEditor.editorGetValue
pure $ mempty { haskell }
Just Javascript -> do
javascript <- pruneEmpty <$> toJavascriptEditor JavascriptEditor.editorGetValue
pure $ mempty { javascript }
Just Actus -> do
actus <- pruneEmpty <$> query _actusBlocklySlot unit (H.request ActusBlockly.GetWorkspace)
pure $ mempty { actus }
Nothing -> mempty
let
files = { playground, marlowe, haskell, javascript, actus, blockly }

newGist = mkNewGist description files
void
$ runMaybeT do
Expand Down

0 comments on commit 78ac31f

Please sign in to comment.