mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-19 06:47:03 +00:00
[curweather] Reset session's curweather_notice_shown when weather available again.
This commit is contained in:
parent
f36b8e24cf
commit
66c685b385
1 changed files with 2 additions and 1 deletions
|
@ -35,11 +35,12 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0)
|
||||||
$res = new SimpleXMLElement(Network::fetchUrl($url));
|
$res = new SimpleXMLElement(Network::fetchUrl($url));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if (!$_SESSION['curweather_notice_shown']) {
|
if (!$_SESSION['curweather_notice_shown']) {
|
||||||
info(L10n::t('Error fetching weather data.\nError was: '.$e->getMessage()));
|
info(L10n::t('Error fetching weather data. Error was: '.$e->getMessage()));
|
||||||
$_SESSION['curweather_notice_shown'] = true;
|
$_SESSION['curweather_notice_shown'] = true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
unset($_SESSION['curweather_notice_shown']);
|
||||||
if ((string)$res->temperature['unit']==='metric') {
|
if ((string)$res->temperature['unit']==='metric') {
|
||||||
$tunit = '°C';
|
$tunit = '°C';
|
||||||
$wunit = 'm/s';
|
$wunit = 'm/s';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue