Fix sending "undefined" to sync favorites
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
d1019373ce
commit
d4b3f7844c
@ -3806,14 +3806,22 @@ AJAX.registerOnload('functions.js', function () {
|
||||
|
||||
// Sync favorite tables from localStorage to pmadb.
|
||||
if ($('#sync_favorite_tables').length) {
|
||||
var favoriteTables = '';
|
||||
if (isStorageSupported('localStorage')
|
||||
&& typeof window.localStorage.favoriteTables !== 'undefined'
|
||||
&& window.localStorage.favoriteTables !== 'undefined') {
|
||||
favoriteTables = window.localStorage.favoriteTables;
|
||||
if (favoriteTables === 'undefined') {
|
||||
// Do not send an invalid value
|
||||
return;
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url: $('#sync_favorite_tables').attr('href'),
|
||||
cache: false,
|
||||
type: 'POST',
|
||||
data: {
|
||||
'favoriteTables': (isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined')
|
||||
? window.localStorage.favoriteTables
|
||||
: '',
|
||||
'favoriteTables': favoriteTables,
|
||||
'server': CommonParams.get('server'),
|
||||
'no_debug': true
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user