Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 15 10:38
    alex-lairan opened #546
  • Apr 21 10:13
    gdotdesign closed #545
  • Apr 20 18:04
    michaelowens edited #545
  • Apr 20 18:01
    michaelowens opened #545
  • Apr 20 13:22
    MarcusE1W closed #544
  • Apr 20 11:58
    Sija closed #391
  • Apr 20 11:06
    gdotdesign labeled #544
  • Apr 20 10:39
    MarcusE1W opened #544
  • Apr 14 22:37
    Sija closed #521
  • Apr 14 09:22
    gdotdesign locked #542
  • Apr 14 05:45
    kojix2 opened #542
  • Apr 11 08:30
    gdotdesign closed #541
  • Apr 11 08:12
    RobertGard opened #541
  • Apr 11 03:55
    gdotdesign labeled #540
  • Apr 11 03:55
    gdotdesign labeled #540
  • Apr 11 03:55
    gdotdesign labeled #540
  • Apr 10 19:44
    Sija edited #540
  • Apr 10 19:35
    midnightmonster opened #540
  • Apr 07 13:33
    gdotdesign synchronize #532
  • Apr 07 13:25
    gdotdesign synchronize #532
Medet Ahmetson
@ahmetson

So here is what I am doing:

in Account storage I have a connection state. The connection state could be either Disconnected, Connected and WrongNetwork. By defaults its set to Disconnected.
In the Main component I have a case statement:

 component Main {
  connect Account exposing { connection }

  fun render : Html {
    case(connection) {
      AccountState::Disconnected => <Loading />
      AccountState::WrongNetwork => <Loading />
      AccountState::Connected => 
        <div:>
          <Logo/>
        </div>
    }
  }
}

Then, in Loading component, I ask user to connect his crypto wallet. If the connected wallet is correct, then I update the connection state to Connected and it works fine in Main component. However, if I update the state to WrongNetwork it doesn't render the Loading component. I think the Mint compiler doesn't reload the Loadingcomponent.

@gdotdesign
Inside the Loading component, I show an error message depending on the Account.connection state.
Szikszai Gusztáv
@gdotdesign
hmm..., it should re-render the Main component when something in Account changes
Medet Ahmetson
@ahmetson
If I add Loading wrongNetwork={true} /> it re-renders. Even though, I am not using the wrongNetwork property.
Szikszai Gusztáv
@gdotdesign
If you put a Debug.log(connection) instead of connection in the case does the value differ?
Medet Ahmetson
@ahmetson
Let me check
Szikszai Gusztáv
@gdotdesign
The Loading component is connected to the Account store?
Medet Ahmetson
@ahmetson
No, Loading component is not.
Perfect, when I connected it, it worked like a charm.
So, Mint allows to call Storage without connecting to it.
@gdotdesign you have a knowledge of Mint. :)
Szikszai Gusztáv
@gdotdesign
Yeah, since I wrote the damn thing :smile:
Medet Ahmetson
@ahmetson
Yeah, it would be nice, to add some crypto related library into it. I am trying to write a single page webapp to interact with Crypto.
Szikszai Gusztáv
@gdotdesign
:+1:
Medet Ahmetson
@ahmetson
My company doesn't allow to publish the code due to privacy reason. But I will try to extract the part that works with Crypto, and make it open source. Hope some people will find it useful among Mint community. :)
Szikszai Gusztáv
@gdotdesign
That would be great! Let me know if you have any questions!
Medet Ahmetson
@ahmetson
@gdotdesign how to convert Number to Bool?
https://www.mint-lang.com/api/modules/Bool could not find any helpful helper function here.
Szikszai Gusztáv
@gdotdesign
module Number {
  fun toBool (number : Number) : Bool {
    case (number) {
      1 => true
      => false
    }
  }
}
yc
@cloutiy
Brilliant
ryanprior
@ryanprior:matrix.org
[m]
I recall there being a way to tell mint to skip minifying CSS class names, but I can't find it in the docs.
I'm doing some testing & it would be handy to use some real (long) CSS class names. Is that doable?
Szikszai Gusztáv
@gdotdesign
Long CSS class names are not possible at the moment. How are you doing the testing?
ryanprior
@ryanprior:matrix.org
[m]
I'm trying quickstrom (https://quickstrom.io/) which uses CSS selectors to query application state
One of my tests I wrote checks the behavior of a form, which becomes visible when you click on a button (and the button becomes invisible.)
I gave the button a class manually, so I can find it with "a.new-room" - but the class which hides or unhides the button is a dynamic mint class, which I used the DOM inspector to discover is called "r".
If I query for "a.new-room.r" then my query can find the CSS "display" property and check if the element is hidden, but if I just query for "a.new-room" that CSS property isn't present.
Perhaps this is a problem with the query system, or likely I'm using it wrong being very new to purescript and quickstrom
But I thought if I could put mint in a mode where it used a stable class name instead of a minified one, that might at least be less prone to breakage.
Szikszai Gusztáv
@gdotdesign
If you are adding a class manually I would use an attribute instead data-test="new-room" or accessibility attributes.
ryanprior
@ryanprior:matrix.org
[m]
I switched to use data attributes and it's working great, nice suggestion. It would be cool to have a feature for testing that does this automatically, such that if I create a <div::name> it gives it a data-mint-class="name" attribute.
ryanprior
@ryanprior:matrix.org
[m]
Do you have an example of running mint test using a webdriver instead of a local browser?
Szikszai Gusztáv
@gdotdesign
mint test doesn't use a webdriver
ryanprior
@ryanprior:matrix.org
[m]
Oh, how does it work then? I didn't find much detail about that.
I assumed it was starting a browser locally to remotely pilot it like a webdriver.
Szikszai Gusztáv
@gdotdesign
It is working like that but not using webdriver but instead a websocket connection, part of it is here: https://github.com/mint-lang/mint/blob/master/core/source/Test/Html.mint
ryanprior
@ryanprior:matrix.org
[m]
Congrats on release 0.16, I'll try it out this weekend
ryanprior
@ryanprior:matrix.org
[m]
Doesn't seem like mint got updated in Docker, maybe CI is broken? https://hub.docker.com/r/mintlang/mint/tags
The "latest" tag gives mint 0.15, which isn't even tagged on dockerhub:
$ docker run --rm -it mintlang/mint version
Mint 0.15.0-devel
Szikszai Gusztáv
@gdotdesign
Yes it is broken because we would need to pay for it, I applied to the open source version of it, we will see if it get it.
ryanprior
@ryanprior:matrix.org
[m]
You would need to pay to push to DockerHub?
Can you push to the GitHub registry instead?
(or in addition)
Szikszai Gusztáv
@gdotdesign
Oh, I didn't think of the Github registry, good idea.
ryanprior
@ryanprior:matrix.org
[m]
How come the sandbox doesn't support Time.fromIso?
Also, hi Mint team, hope you all are well =D
tkshnwesper
@tkshnwesper
Hi folks, could someone please merge this:
mint-lang/homebrew-mint-lang#4
tkshnwesper
@tkshnwesper
thanks!