mirror of
https://github.com/mue/mue.git
synced 2026-07-11 18:31:47 +02:00
fix: new radio buttons, fix background bugs etc
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -100,10 +100,10 @@ export default class Background extends React.PureComponent {
|
||||
if (customBackgroundColour !== 'Disabled' && customBackgroundColour !== '') {
|
||||
let gradientSettings = '';
|
||||
try {
|
||||
gradientSettings = JSON.parse(colour);
|
||||
gradientSettings = JSON.parse(customBackgroundColour);
|
||||
} catch (e) {
|
||||
const hexColorRegex = /#[0-9a-fA-F]{6}/s;
|
||||
if (hexColorRegex.exec(colour)) {
|
||||
if (hexColorRegex.exec(customBackgroundColour)) {
|
||||
// Colour use to be simply a hex colour or a NULL value before it was a JSON object. This automatically upgrades the hex colour value to the new standard. (NULL would not trigger an exception)
|
||||
gradientSettings = { "type": "linear", "angle": "180", "gradient": [{ "colour": colour, "stop": 0 }] };
|
||||
localStorage.setItem('customBackgroundColour', JSON.stringify(gradientSettings));
|
||||
|
||||
@@ -57,6 +57,10 @@ export default class Quote extends React.PureComponent {
|
||||
}
|
||||
|
||||
async getQuote() {
|
||||
if (localStorage.getItem('offlineMode') === 'true') {
|
||||
return this.doOffline();
|
||||
}
|
||||
|
||||
const quotePackAPI = JSON.parse(localStorage.getItem('quoteAPI'));
|
||||
if (quotePackAPI) {
|
||||
try {
|
||||
@@ -86,10 +90,6 @@ export default class Quote extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
if (localStorage.getItem('offlineMode') === 'true') {
|
||||
return this.doOffline();
|
||||
}
|
||||
|
||||
// First we try and get a quote from the API...
|
||||
try {
|
||||
const data = await (await fetch(window.constants.API_URL + '/getQuote?language=' + localStorage.getItem('quotelanguage'))).json();
|
||||
|
||||
Reference in New Issue
Block a user