Skip to content

Commit

Permalink
removed warning if version.txt does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
JavanXD committed May 1, 2019
1 parent e6b885a commit 0e3946d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion backend/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ function getVersionInfo() {
$obj->webinterface = json_decode($contentWebinterface);

// read current versionInfo
$obj->versionInfo = file_get_contents("/var/www/html/version.txt");
$versionInfo_file = "/var/www/html/version.txt";
if (file_exists($versionInfo_file)) {
$obj->versionInfo = file_get_contents($versionInfo_file);
}


return $obj;
} catch (Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
<script type="text/javascript" src="assets/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="assets/popper.min.js"></script>
<script type="text/javascript" src="assets/bootstrap-4.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.2f67a12a18dc8be50759.js"></script><script type="text/javascript" src="main.a18019447e7b6c0dbfcb.js"></script></body>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.2f67a12a18dc8be50759.js"></script><script type="text/javascript" src="main.b70317452c48c12cb620.js"></script></body>
</html>

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/app/components/update/update.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class UpdateComponent implements OnInit {
console.error(err);
this.log = err;
if (err.name && err.name === 'TimeoutError') {
this.log = 'Timeout.';
this.log = 'TimeoutError.';
} else if (err.name && err.name === 'HttpErrorResponse') {
this.log = 'Connection failed.';
this.log = 'HttpErrorResponse.';
}
});
}
Expand Down

0 comments on commit 0e3946d

Please sign in to comment.