forked from GNUsocial/gnu-social
Catches GeoCookie JSON parsing error
This commit is contained in:
parent
75711ae06a
commit
8be96a7ebe
24
js/util.js
24
js/util.js
@ -1177,18 +1177,22 @@ var SN = { // StatusNet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));
|
try {
|
||||||
|
var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));
|
||||||
|
|
||||||
form.find('[name=lat]').val(cookieValue.NLat);
|
form.find('[name=lat]').val(cookieValue.NLat);
|
||||||
form.find('[name=lon]').val(cookieValue.NLon);
|
form.find('[name=lon]').val(cookieValue.NLon);
|
||||||
form.find('[name=location_ns]').val(cookieValue.NLNS);
|
form.find('[name=location_ns]').val(cookieValue.NLNS);
|
||||||
form.find('[name=location_id]').val(cookieValue.NLID);
|
form.find('[name=location_id]').val(cookieValue.NLID);
|
||||||
form.find('[name=notice_data-geo]').prop('checked', cookieValue.NDG);
|
form.find('[name=notice_data-geo]').prop('checked', cookieValue.NDG);
|
||||||
|
|
||||||
SN.U.NoticeGeoStatus(form, cookieValue.NLN, cookieValue.NLat, cookieValue.NLon, cookieValue.NLNU);
|
SN.U.NoticeGeoStatus(form, cookieValue.NLN, cookieValue.NLat, cookieValue.NLon, cookieValue.NLNU);
|
||||||
label
|
label
|
||||||
.attr('title', NoticeDataGeo_text.ShareDisable + ' (' + cookieValue.NLN + ')')
|
.attr('title', NoticeDataGeo_text.ShareDisable + ' (' + cookieValue.NLN + ')')
|
||||||
.addClass('checked');
|
.addClass('checked');
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Parsing error:', e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
removeNoticeDataGeo();
|
removeNoticeDataGeo();
|
||||||
|
Loading…
Reference in New Issue
Block a user