From 1081c491339c39246ae367f60da885f7bd29ab66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Sun, 27 Mar 2022 22:16:06 +0200 Subject: [PATCH] Fix installer without version number in URL --- src/App.tsx | 12 +++++++----- src/components/downloads/Downloads.tsx | 5 ++++- src/dfu/installer.ts | 3 +-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 36f810e..5f973df 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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"; @@ -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]; @@ -75,7 +77,7 @@ function App() { /> {/* */} - + diff --git a/src/components/downloads/Downloads.tsx b/src/components/downloads/Downloads.tsx index 24472e0..94124d6 100644 --- a/src/components/downloads/Downloads.tsx +++ b/src/components/downloads/Downloads.tsx @@ -41,7 +41,10 @@ export class Downloads extends Component { {this.getReleaseVersion(latest_version.name)}
- + system_update_alt diff --git a/src/dfu/installer.ts b/src/dfu/installer.ts index 3f2371e..e63423e 100644 --- a/src/dfu/installer.ts +++ b/src/dfu/installer.ts @@ -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(