mirror of
https://github.com/mue/mue.git
synced 2026-07-19 15:04:11 +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));
|
||||
|
||||
Reference in New Issue
Block a user