angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Broadcast fired twice

Open philippeluickx opened this issue 9 years ago • 0 comments

I am listening on language changes. I do a setLanguage and then a loadRemote to load up a new language. However, both fire a broadcast by calling broadcastUpdated().

  1. setCurrentLanguage https://github.com/rubenv/angular-gettext/blob/8959f4457033f49884a65038b91da2cfe21a5a9b/src/catalog.js#L139
  2. setString https://github.com/rubenv/angular-gettext/blob/8959f4457033f49884a65038b91da2cfe21a5a9b/src/catalog.js#L163

My follow-up action includes communication with backend, which is happening twice then.

I see 2 options, either we skip the broadcast in setStrings or we apply a setCurrentLanguage in setStrings.

philippeluickx avatar Aug 22 '16 12:08 philippeluickx