mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:59:59 +02:00
Fixed having invalid custom gradient colors
This commit is contained in:
parent
0e8a452071
commit
c6775bae20
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue