fix: task default color should be set and evaluated properly

This commit is contained in:
kolaente 2022-06-16 18:11:42 +02:00
parent 7ef0d8c4ea
commit 37c36560fb
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
2 changed files with 7 additions and 4 deletions

View file

@ -8,6 +8,7 @@ import SubscriptionModel from '@/models/subscription'
import {parseDateOrNull} from '@/helpers/parseDateOrNull'
const SUPPORTS_TRIGGERED_NOTIFICATION = 'Notification' in window && 'showTrigger' in Notification.prototype
export const TASK_DEFAULT_COLOR = '#1973ff'
export default class TaskModel extends AbstractModel {
constructor(data) {
@ -187,8 +188,8 @@ export default class TaskModel extends AbstractModel {
}
getHexColor() {
if (this.hexColor === '') {
return `#${this.defaultColor}`
if (this.hexColor === '' || this.hexColor === '#') {
return TASK_DEFAULT_COLOR
}
return this.hexColor