-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac) #7867
Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac) #7867
Conversation
r ? @etiennesegonzac |
} else { | ||
} else if (document.readyState === 'interactive') { | ||
window.addEventListener('load', l10nStartup); | ||
} else if (document.readyState === 'loading') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually when the state is interactive we can go ahead, let's have
if (typeof(document) !== 'undefined') {
if (document.readyState === 'complete' ||
document.readyState === 'interactive') {
window.setTimeout(l10nStartup);
} else {
document.addEventListener('DOMContentLoaded', l10nStartup);
}
}
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including it and testing it... ;-) Thanks!
@etiennesegonzac , suggestion included and working... ;-) If you are OK with the final changes, please be my guest and merge the pull request... ;-) I'll evolve the bug in Bugzilla to fixed as soon as you merge it ;-) Thanks! |
Switching to Mr. @arcturus since Mr. @etiennesegonzac is enjoying a more than deserved holidays... ;-) Please, @arcturus , would you be so kind to check this PR including @etiennesegonzac 's comment? Thank you very much! |
r=me (in the absence of @etiennesegonzac :P) |
Merging it ;-) Thank you guys! :-) |
…ation-not-loading-in-attention-screen Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)
…ation-not-loading-in-attention-screen Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)(cherry picked from commit 345162a)
…ation-not-loading-in-attention-screen Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)(cherry picked from commit 345162a)
The localization feature was not working in the Comms incoming and outgoing attention screens due to a problem in the lazy loading of this feature.
The source of the problem in this code snippet: https://github.com/mozilla-b2g/gaia/blob/master/shared/js/l10n.js#L949
More concretely, in the case of the incoming/outgoing attention screen, the lazy loading of the localization feature in the Comms app caused the previously mentioned code snippet to be executed with document.readyState equal to 'interactive' and consequently the listener added via document.addEventListener('DOMContentLoaded', l10nStartup) never ran (since the DOMContentLoaded has been already fired, if not the document.readyState wouldn't be 'interactive') and consequently the l10nStartup function was never executed which was causing the localization capabilities to fail ;-999