Skip to content

Commit

Permalink
Fix installer without version number in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Mar 27, 2022
1 parent 63d13df commit 1081c49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import classNames from "classnames";
import React, { useState } from "react";
import { IntlProvider } from "react-intl";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import {
BrowserRouter as Router,
Redirect,
Route,
Switch,
} from "react-router-dom";
import CookiesConsent from "./components/cookiesconsent/CookiesConsent";
import Footer from "./components/footer/Footer";
import Header from "./components/header/Header";
Expand All @@ -22,9 +27,6 @@ import FullSimulator from "./pages/simulator/FullSimulator";
import "./sass/omega.library.sass";
import TiPlanetConnector from "./TiPlanetConnector";




function App() {
const getLang = () => {
if (navigator.languages !== undefined) return navigator.languages[0];
Expand Down Expand Up @@ -75,7 +77,7 @@ function App() {
/>
<Route path="/releases" component={Releases} exact />
{/* <Route path="/beta" component={Beta} exact /> */}
<Route path="/install" component={Install} exact />
<Redirect path="/install" to="/install/latest" exact />
<Route path="/install/:version" component={Install} />
<Route path="/policy" component={Policy} exact />
<Route path="/archiving" component={Archiving} exact />
Expand Down
5 changes: 4 additions & 1 deletion src/components/downloads/Downloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export class Downloads extends Component {
{this.getReleaseVersion(latest_version.name)}
</h2>
<div className="download__cards">
<Link to="/install" className="download__cards__card">
<Link
to="/install/latest"
className="download__cards__card"
>
<span className="download__cards__card__icon">
<i className="material-icons">system_update_alt</i>
</span>
Expand Down
3 changes: 1 addition & 2 deletions src/dfu/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { betas as betaReleases } from "../firmware/betas";
import {
Firmware,
releases as finalReleases,
Releases
Releases,
} from "../firmware/firmwares";
import Install from "../pages/Install";
import Downloader from "./downloader";


// use JSON.parse(JSON.stringify()) to do a deep copy to avoid problems
var releasesList: Releases = JSON.parse(JSON.stringify(finalReleases));
releasesList["firmwares"] = releasesList.firmwares.concat(
Expand Down

1 comment on commit 1081c49

@vercel
Copy link

@vercel vercel bot commented on 1081c49 Mar 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.