Commit a87133ef authored by Sebastien Robin's avatar Sebastien Robin

more bug fixes from Francois

parent 86916499
......@@ -39,8 +39,6 @@ function tryLog() {
wallet.applicationPassword = applicationPassword;
setWallet(wallet);//to delete for new registration each time
initStorage(wallet);
//go to ung when the storage is ready
waitBeforeSucceed(function() {return getCurrentStorage().getUser();},function(){window.location.href = "ung.html";});
}
}
......@@ -58,7 +56,6 @@ function logUser() {
}
initStorage(wallet);
//go to ung when the storage is ready
waitBeforeSucceed(function() {return getCurrentStorage().getUser();},function(){window.location.href = "ung.html";});
}
......
......@@ -218,6 +218,7 @@ Storage.load({
success: function(data) {//success
storage.setUser(new User(JSON.parse(data)));
storage.save();
storage.fireEvent(Storage.STORAGE_CREATED);
},
errorHandler: function(errorEvent) {//fail
if(errorEvent.status==404){//create a new user if there was no such one
......@@ -226,6 +227,7 @@ Storage.load({
storage.setUser(user);
storage.user.storageLocation = jioFileContent.location;
storage.save();
storage.fireEvent(Storage.STORAGE_CREATED);
}
},
asynchronous: false
......@@ -247,6 +249,7 @@ Storage.load({
},
USER_READY: "userReady", // value of the USER_READY event
LIST_READY: "listReady", // value of the LIST_READY event
STORAGE_CREATED: "storageCreated", // value of the STORAGE_CREATED event
getJIO: function() {return this.jio;},
loadUser: function(userName) {//warning no return value
......
......@@ -31,6 +31,9 @@
<script type="text/javascript">
var init = function() {
//go to ung when the storage is ready
Storage.addEventHandler(function() {window.location.href = "ung.html";},Storage.STORAGE_CREATED,true);
//fill known informations
var wallet = getWallet();
if(wallet) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment