fix(background): custom colour default

This commit is contained in:
David Ralph
2026-01-24 21:38:00 +00:00
parent 07a6e2bbf4
commit 6f1b81d503

View File

@@ -10,31 +10,22 @@ import '../scss/_colourpicker.scss';
const ColourOptions = () => { const ColourOptions = () => {
const [colour, setColour] = useState( const [colour, setColour] = useState(
localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 0)', localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 100)',
); );
const changeColour = (output) => { const changeColour = (output) => {
setColour(output); setColour(output);
localStorage.setItem('customBackgroundColour', output); localStorage.setItem('customBackgroundColour', output);
EventBus.emit('refresh', 'background'); EventBus.emit('refresh', 'background');
showReminder();
}; };
const resetColour = () => { const resetColour = () => {
setColour('rgba(0, 0, 0, 0)'); setColour('rgba(0, 0, 0, 0)');
localStorage.setItem('customBackgroundColour', 'rgba(0, 0, 0, 0)'); localStorage.setItem('customBackgroundColour', 'rgba(0, 0, 0, 100)');
toast(variables.getMessage('toasts.reset')); toast(variables.getMessage('toasts.reset'));
EventBus.emit('refresh', 'background'); EventBus.emit('refresh', 'background');
showReminder();
}; };
const showReminder = () => {
const reminderInfo = document.querySelector('.reminder-info');
if (reminderInfo.style.display !== 'block') {
reminderInfo.style.display = 'block';
localStorage.setItem('showReminder', true);
}
};
return ( return (
<Row final={true}> <Row final={true}>