From dc442ef917b272d7fa26bbc389c95834f221c673 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 20 Jun 2021 13:09:41 +0100 Subject: [PATCH] fix: upgrading from 5.0.1 to latest now works, code style changes etc --- manifest/chrome.json | 2 +- manifest/firefox.json | 2 +- package.json | 8 ++++---- src/App.jsx | 3 ++- .../modals/main/settings/sections/About.jsx | 5 +++-- .../modals/main/settings/sections/Appearance.jsx | 12 ++++++------ .../modals/main/settings/sections/Changelog.jsx | 4 +++- .../modals/main/settings/sections/Time.jsx | 8 ++++---- .../modals/main/settings/sections/Weather.jsx | 12 ++++++------ 9 files changed, 30 insertions(+), 26 deletions(-) diff --git a/manifest/chrome.json b/manifest/chrome.json index 8fb1b840..77020989 100644 --- a/manifest/chrome.json +++ b/manifest/chrome.json @@ -1,5 +1,5 @@ { - "manifest_version": 3, + "manifest_version": 2, "offline_enabled": true, "name": "Mue", "description": "Fast, open and free-to-use new tab page for modern browsers.", diff --git a/manifest/firefox.json b/manifest/firefox.json index b18aa544..cc2c5a5d 100644 --- a/manifest/firefox.json +++ b/manifest/firefox.json @@ -1,5 +1,5 @@ { - "manifest_version": 3, + "manifest_version": 2, "name": "Mue", "description": "Fast, open and free-to-use new tab page for modern browsers.", "version": "5.0.1", diff --git a/package.json b/package.json index 2e35346d..5067b9de 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "weather-icons-react": "1.2.0" }, "devDependencies": { - "@babel/core": "^7.14.5", + "@babel/core": "^7.14.6", "@babel/eslint-parser": "^7.14.5", "@babel/plugin-proposal-class-properties": "^7.14.5", "@babel/plugin-transform-react-constant-elements": "^7.13.15", @@ -43,10 +43,10 @@ "eslint-config-react-app": "^6.0.0", "html-webpack-plugin": "^5.3.1", "mini-css-extract-plugin": "^1.6.0", - "sass": "^1.34.1", - "sass-loader": "^12.1.0", + "sass": "^1.35.1", + "sass-loader": "^7.3.1", "source-map-loader": "^3.0.0", - "webpack": "^5.38.1", + "webpack": "^5.39.1", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2" }, diff --git a/src/App.jsx b/src/App.jsx index 21cdee2c..e64cc01d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -17,7 +17,8 @@ export default class App extends React.PureComponent { } // 4.0 -> 5.0 (the key below is only on 5.0) - if (!localStorage.getItem('order')) { + // now featuring 5.0 -> 5.1 + if (!localStorage.getItem('order') || !localStorage.getItem('autocompleteProvider')) { SettingsFunctions.moveSettings(); window.location.reload(); } diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/components/modals/main/settings/sections/About.jsx index 3b3653ee..3e2bba5c 100644 --- a/src/components/modals/main/settings/sections/About.jsx +++ b/src/components/modals/main/settings/sections/About.jsx @@ -28,11 +28,12 @@ export default class About extends React.PureComponent { let contributors, sponsors, photographers, versionData; try { + versionData = await (await fetch(window.constants.GITHUB_URL + '/repos/mue/mue/releases', { signal: this.controller.signal })).json(); + contributors = await (await fetch(window.constants.GITHUB_URL + '/repos/mue/mue/contributors', { signal: this.controller.signal })).json(); sponsors = (await (await fetch(window.constants.SPONSORS_URL + '/list', { signal: this.controller.signal })).json()).sponsors; + photographers = await (await fetch(window.constants.API_URL + '/images/photographers', { signal: this.controller.signal })).json(); - - versionData = await (await fetch(window.constants.GITHUB_URL + '/repos/mue/mue/releases', { signal: this.controller.signal })).json(); } catch (e) { if (this.controller.signal.aborted === true) { return; diff --git a/src/components/modals/main/settings/sections/Appearance.jsx b/src/components/modals/main/settings/sections/Appearance.jsx index c8aa61b5..f5cbf72c 100644 --- a/src/components/modals/main/settings/sections/Appearance.jsx +++ b/src/components/modals/main/settings/sections/Appearance.jsx @@ -11,16 +11,16 @@ export default function AppearanceSettings() { const themeOptions = [ { - 'name': appearance.theme.auto, - 'value': 'auto' + name: appearance.theme.auto, + value: 'auto' }, { - 'name': appearance.theme.light, - 'value': 'light' + name: appearance.theme.light, + value: 'light' }, { - 'name': appearance.theme.dark, - 'value': 'dark' + name: appearance.theme.dark, + value: 'dark' } ]; diff --git a/src/components/modals/main/settings/sections/Changelog.jsx b/src/components/modals/main/settings/sections/Changelog.jsx index ba78379f..983fbd89 100644 --- a/src/components/modals/main/settings/sections/Changelog.jsx +++ b/src/components/modals/main/settings/sections/Changelog.jsx @@ -27,7 +27,9 @@ export default class Changelog extends React.PureComponent { let date = new Date(data.date); date = date.toLocaleDateString(window.languagecode.replace('_', '-'), { - year: 'numeric', month: 'long', day: 'numeric' + year: 'numeric', + month: 'long', + day: 'numeric' }); this.setState({ diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index ae6ca8a3..ce587277 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -23,12 +23,12 @@ export default class TimeSettings extends React.PureComponent { const digitalOptions = [ { - 'name': time.digital.twentyfourhour, - 'value': 'twentyfourhour' + name: time.digital.twentyfourhour, + value: 'twentyfourhour' }, { - 'name': time.digital.twelvehour, - 'value': 'twelvehour' + name: time.digital.twelvehour, + value: 'twelvehour' } ]; diff --git a/src/components/modals/main/settings/sections/Weather.jsx b/src/components/modals/main/settings/sections/Weather.jsx index f6c303bc..cfa40ab6 100644 --- a/src/components/modals/main/settings/sections/Weather.jsx +++ b/src/components/modals/main/settings/sections/Weather.jsx @@ -49,16 +49,16 @@ export default class TimeSettings extends React.PureComponent { const tempFormat = [ { - 'name': language.temp_format.celsius + ' (°C)', - 'value': 'celsius' + name: language.temp_format.celsius + ' (°C)', + value: 'celsius' }, { - 'name': language.temp_format.fahrenheit + ' (°F)', - 'value': 'fahrenheit' + name: language.temp_format.fahrenheit + ' (°F)', + value: 'fahrenheit' }, { - 'name': language.temp_format.kelvin + ' (K)', - 'value': 'kelvin' + name: language.temp_format.kelvin + ' (K)', + value: 'kelvin' } ];