Commit 77966ec9 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Fix bug: user name was added even if the it already exists (jio local storage)

parent df16f201
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
'creation_date': Date.now(), 'creation_date': Date.now(),
'last_modified': Date.now() 'last_modified': Date.now()
}; };
if (!priv.userExists()){ if (!priv.userExists(that.getStorageUserName())) {
priv.addUser (that.getStorageUserName()); priv.addUser (that.getStorageUserName());
} }
priv.addFileName(that.getFileName()); priv.addFileName(that.getFileName());
...@@ -218,10 +218,12 @@ ...@@ -218,10 +218,12 @@
for (i = 0, l = array.length; i < l; i += 1) { for (i = 0, l = array.length; i < l; i += 1) {
file_object = file_object =
LocalOrCookieStorage.getItem(path+'/'+array[i]); LocalOrCookieStorage.getItem(path+'/'+array[i]);
new_array.push ({ if (file_object) {
'name':file_object.name, new_array.push ({
'creation_date':file_object.creation_date, 'name':file_object.name,
'last_modified':file_object.last_modified}); 'creation_date':file_object.creation_date,
'last_modified':file_object.last_modified});
}
} }
that.done(new_array); that.done(new_array);
}, 100); }, 100);
......
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