♻️ only store versions on success

We should only overwrite latest_version if retreiving from GitHub went
ok, else we should keep the old values and store "null".
This commit is contained in:
Lucas Bickel 2018-11-21 02:25:27 +01:00
parent c0124b6245
commit b65c040394

View file

@ -909,13 +909,13 @@ class Application_Model_Preference
$versions[] = $item->get_title();
}
$latest = $versions;
self::setValue('latest_version', json_encode($latest));
self::setValue('latest_version_nextcheck', strtotime('+1 week'));
if (empty($latest)) {
return array($config['airtime_version']);
} else {
return $latest;
}
self::setValue('latest_version', json_encode($latest));
return $latest;
}
public static function SetLatestVersion($version)