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:
Git Repository
2018-04-27 23:28:47 -07:00
parent 04073b20d4
commit 64a56cb2ec
2 changed files with 53 additions and 39 deletions
@@ -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
]);
}
}
}