mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-04 01:09:58 -05:00
Update VersionCheck Component
Updated the version check component. 1) Line 25 (Version.vue) was checking for a boolean but a string is returned from VersionController. 2) Line 37 (VersionController.php) was returning “true” if the current version was less then latest version. The version component was only showing “There Is A Update Available” if the return data was false. This was not triggered if the current version is less then the available version Example v1.6 installed < v1.7 latest.
This commit is contained in:
@@ -34,6 +34,9 @@ class VersionController extends Controller
|
||||
$client = new Client();
|
||||
$response = json_decode($client->get('https://api.github.com/repos/HDInnovations/UNIT3D/releases')->getBody());
|
||||
$lastestVersion = $response[0]->tag_name;
|
||||
return response(['updated' => version_compare($this->version, $lastestVersion, '<') ? 'true' : 'false']);
|
||||
return response([
|
||||
'updated' => version_compare($this->version, $lastestVersion, '<') ? 'false' : 'true',
|
||||
'latestversion' => $lastestVersion
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user