Commit 2000d2d3 authored by Sarven Capadisli's avatar Sarven Capadisli

Added timeout error handling for geo location

parent 9b2fdefe
......@@ -632,9 +632,18 @@ var SN = { // StatusNet
},
function(error) {
if (error.PERMISSION_DENIED == 1) {
removeNoticeDataGeo();
switch(error.code) {
case error.PERMISSION_DENIED:
removeNoticeDataGeo();
break;
case error.TIMEOUT:
$('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing');
break;
}
},
{
timeout: 10000
}
);
}
......
......@@ -213,7 +213,8 @@ class NoticeForm extends Form
$this->out->elementEnd('div');
$this->out->inlineScript(' var NoticeDataGeo_text = {'.
'ShareDisable: "'._('Do not share my location').'",'.
'InfoMinimize: "'._('Hide this info').'"'.
'InfoMinimize: "'._('Hide this info').'",'.
'ErrorTimeout: "'._('Sorry, retrieving your geo location is taking longer than expected, please try again later').'"'.
'}');
}
......
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