Fixed having invalid custom gradient colors

This commit is contained in:
mr. M 2024-11-02 19:29:15 +01:00
parent 0e8a452071
commit c6775bae20
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -288,7 +288,7 @@
async addCustomColor() { async addCustomColor() {
const color = this.customColorInput.value; const color = this.customColorInput.value;
if (!color || !color.match(/^#[0-9a-f]{3,6}$/i)) { if (!color || !color.match(/^#[0-9a-f]{3,8}$/i)) {
return; return;
} }
// can be any color format, we just add it to the list as a dot, but hidden // can be any color format, we just add it to the list as a dot, but hidden
@ -461,6 +461,9 @@
// get the theme from the window // get the theme from the window
workspaceTheme = theme || windowWorkspace.theme; workspaceTheme = theme || windowWorkspace.theme;
workspaceTheme.gradientColors = workspaceTheme.gradientColors.filter(color =>
color.isCustom ? color.c.match(/^#[0-9a-f]{3,8}$/i) : true
);
const appWrapper = browser.document.getElementById('zen-main-app-wrapper'); const appWrapper = browser.document.getElementById('zen-main-app-wrapper');
if (!skipUpdate) { if (!skipUpdate) {