diff --git a/feedbacks.js b/feedbacks.js index ba630ceffdc7612a5978d21f8917eeadaece1205..1ce4ec3917fcedaf9a8c4a2d02f960c450f53aee 100644 --- a/feedbacks.js +++ b/feedbacks.js @@ -34,14 +34,16 @@ module.exports = async function (self) { if (pad != null) { self.log('debug', `Update feedback for pad id ${pad.id} with status ${pad.status}`); if (pad.status === 'PLAY') { + let design = pad.design.play ?? self.currentProject.getDesign().play; return { - bgcolor: hexStringToNumber(pad.design.play.hi), - color: hexStringToNumber(pad.design.play.font) + bgcolor: hexStringToNumber(design.hi), + color: hexStringToNumber(design.font) }; } else { + let design = pad.design.normal ?? self.currentProject.getDesign().normal; return { - bgcolor: hexStringToNumber(pad.design.normal.hi), - color: hexStringToNumber(pad.design.normal.font) + bgcolor: hexStringToNumber(design.hi), + color: hexStringToNumber(design.font) }; } } else { diff --git a/project.js b/project.js index 603ba84d737b7488c5ce5c039fad7eb122d76d33..0f54e19d28ba92e7ea994fe76c517dc9aed0b228 100644 --- a/project.js +++ b/project.js @@ -107,4 +107,12 @@ module.exports = class Project { } return null } + + /* + Design + */ + + getDesign() { + return this.data.design; + } } \ No newline at end of file