From de0a1df3ca5c6643c6cf019f8316774eeb973293 Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 20 May 2014 21:35:23 -0700 Subject: [PATCH] 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. --- js/options.js | 14 ++++++++------ options.html | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/js/options.js b/js/options.js index 93ffe45813..a2792b2cf3 100644 --- a/js/options.js +++ b/js/options.js @@ -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(); + } + }); }); diff --git a/options.html b/options.html index 0e9b11db5a..44e70bc4f9 100644 --- a/options.html +++ b/options.html @@ -56,7 +56,7 @@ - +