kawan16 / mithril-translate

Internationalization of your Mithril applications
http://kawan16.github.io/mithril-translate/
23 stars 0 forks source link

Mounting component twice #5

Closed joakimstrandell closed 9 years ago

joakimstrandell commented 9 years ago

I can't seem to understand why a component is mounted twice when using mithril translate. Is someone else experiencing the same issue? Is it supposed to be like this?

var m = require('mithril');
var mx = require('./mithril-translate');

mx.translate.configure({infix: '/i18n/' , suffix: '.json'});

localize.translate.use('en').then(function() {
    m.route(document.body, "/", {
        "/": {controller: function() {}, view: function() { console.log('Test') }}
    });
});

In the example above Test is logged twice in the console.

kawan16 commented 9 years ago

Hi Joakim,

I couldn't reproduce your bug but I got an idea where that can come from. So, I made the fix on the master branch. Let me know if you still get the bug.

joakimstrandell commented 9 years ago

Hi @kawan16

That update worked perfectly. Thanks!

jestillore commented 7 years ago

I'm still having this issue.