Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"push" function doesn't show data the first data update #65

Open
nickgeoca opened this issue Sep 29, 2015 · 1 comment
Open

"push" function doesn't show data the first data update #65

nickgeoca opened this issue Sep 29, 2015 · 1 comment

Comments

@nickgeoca
Copy link

Description: push function requires clicking the submit button one additional time in browser before it receives the data. In other words, push requires two data updates before it shows in browser.
Line: haskell <** push Append 0 (do
Version:

  • GHC 7.10.2
  • MFlow-0.4.5.11

Note this code was found in the tutorial.

{-# LANGUAGE OverloadedStrings #-}

import MFlow.Wai.Blaze.Html.All
import System.IO.Unsafe
import Control.Concurrent.MVar


res = unsafePerformIO $ newEmptyMVar :: MVar Int  

main= runNavigation "" . step . page $ do
   "Hi, I' m not refreshed, unless you "
     ++>  wlink () "click here" 
     <++ " in which case, a navigation happens"

    <** (autoRefresh .  pageFlow "s" $ do
          n  <- "First  "  ++> getInt Nothing   <++ br
          n' <- "Second " ++> getInt (Just n)  <++ br
          liftIO $ putMVar res $ n + n' 
          noWidget 
         <** br ++> pageFlow "button" (submitButton "submit"))

    <** push Append 0  (do
            n <- liftIO  $ takeMVar res  
            b << (show n) ++> br ++> noWidget )
@agocorona
Copy link
Owner

I tried it with this project in FPcomplete:

https://www.fpcomplete.com/user/agocorona/autocloned/mflow-tests

the FPcomplete environment is fantastic, by the way

I just reproduced the problem using Edge and FIrefox

going back again to chrome, with a fresh incognito session the issue is also reproduced

@agocorona agocorona reopened this Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants