Commit ddf0bcf9 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Fix bug: newLocalStorage checkNameAvailability.

parent 74d1cc4e
...@@ -32,16 +32,11 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) { ...@@ -32,16 +32,11 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
var that = Jio.newBaseStorage( spec, my ), priv = {}; var that = Jio.newBaseStorage( spec, my ), priv = {};
priv.storage_file_array_name = 'jio/local/filearray'; priv.storage_file_array_name = 'jio/localfilearray';
priv.getPathArray = function () { priv.getPathArray = function () {
var storage_file_array = return LocalOrCookieStorage.getItem(
LocalOrCookieStorage.getItem(priv.storage_file_array_name); priv.storage_file_array_name) || [];
if (storage_file_array === null) {
LocalOrCookieStorage.setItem(priv.storage_file_array_name,[]);
return [];
}
return storage_file_array;
}; };
priv.addPath = function (path) { priv.addPath = function (path) {
var patharray = priv.getPathArray(); var patharray = priv.getPathArray();
...@@ -71,7 +66,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) { ...@@ -71,7 +66,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
allpatharray = priv.getPathArray(); allpatharray = priv.getPathArray();
for (i = 0; i < allpatharray.length; i += 1) { for (i = 0; i < allpatharray.length; i += 1) {
split = allpatharray.split('/'); split = allpatharray[i].split('/');
if (split[0] === 'jio' && if (split[0] === 'jio' &&
split[1] === 'local' && split[1] === 'local' &&
split[2] === that.getUserName()) { split[2] === that.getUserName()) {
......
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