Skip to content

Commit

Permalink
Add not found page
Browse files Browse the repository at this point in the history
  • Loading branch information
nattolecats committed Jun 15, 2024
1 parent 2f7917c commit eeb1998
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ const initDownloadPage = async () => {
if (!codenameDisplay || !downloadLink || !recoveryLinkContainer) return;

const params = new URLSearchParams(window.location.search);
const device = devices.find((device) => device.codename === params.get('device'));
if (!device) return;
const targetDevice = params.get('device');
const device = devices.find((device) => device.codename === targetDevice);
if (!device) {
nameDisplay.innerText = 'Error: No such device found: ' + targetDevice;
return;
}

const otaDetails = await getOtaDetails(device.codename);

Expand Down
2 changes: 1 addition & 1 deletion download.htm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>
<body>
<center>
<h1 id="device_name"></h1>
<h1 id="device_name">Loading...</h1>
<ul>
<li>Codename: <code id="device_codename"></code></li>
<li>Download latest build: <a id="device_download_link"></a></li>
Expand Down

0 comments on commit eeb1998

Please sign in to comment.