0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed null checks for accent color

no issue

- Fixes null checks for accent color
This commit is contained in:
Rish 2020-07-08 20:54:10 +05:30
parent 4b28df8506
commit a6ab7fd626
2 changed files with 3 additions and 3 deletions

View file

@ -254,7 +254,7 @@ export default class App extends React.Component {
getAccentColor() {
const {accent_color: accentColor = '#3db0ef'} = this.state.site || {};
return accentColor;
return accentColor || '#3db0ef';
}
async onAction(action, data) {

View file

@ -4,8 +4,8 @@ function padZero(str, len) {
return (zeros + str).slice(-len);
}
function invertColor(hex, bw = true) {
if (!hex.match(/#[0-9A-Fa-f]{6}$/)) {
function invertColor(hex = '', bw = true) {
if (!hex || !hex.match(/#[0-9A-Fa-f]{6}$/)) {
// Return white in case not a valid hex
return '#000000';
}