Fix broken registration flow

Better load the functions defined in chromium.js before trying to use
them. Hmm.. also, options.js should probably wait for the DOM to load
before it tries to initialize things in it.
This commit is contained in:
lilia 2014-05-20 21:35:23 -07:00
parent d9bf0a41fb
commit de0a1df3ca
2 changed files with 9 additions and 7 deletions

View file

@ -139,10 +139,12 @@ $('#init-go').click(function() {
});
textsecure.registerOnLoadFunction(function() {
if (!isRegistrationDone()) {
$('#init-setup').show();
} else {
$('#complete-number').html(textsecure.storage.getUnencrypted("number_id").split(".")[0]);
$('#setup-complete').show();
}
$(function() {
if (!isRegistrationDone()) {
$('#init-setup').show();
} else {
$('#complete-number').html(textsecure.storage.getUnencrypted("number_id").split(".")[0]);
$('#setup-complete').show();
}
});
});

View file

@ -56,7 +56,7 @@
<script type="text/javascript" src="js/crypto.js"></script>
<script type="text/javascript" src="js/api.js"></script>
<script type="text/javascript" src="js/helpers.js"></script>
<script type="text/javascript" src="js/options.js"></script>
<script type="text/javascript" src="js/chromium.js"></script>
<script type="text/javascript" src="js/options.js"></script>
</body>
</html>