Renamed Notification mixin's warn and error methods.

Renamed to `notifyWarning` and `notifyError` respectively.

Those names can often clash with other properties defined on components
that extend the mixin (like entities).
This commit is contained in:
Fabio Manganiello 2023-01-14 22:27:43 +01:00
parent aa22507f50
commit fd2d83c80b
Signed by: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 4 additions and 4 deletions

View file

@ -229,7 +229,7 @@ export default {
const eventType = this.animationRunning ? 'stop' : 'start' const eventType = this.animationRunning ? 'stop' : 'start'
const selectedLights = Object.entries(this.selectedLights).filter((light) => light[1]).map((light) => light[0]) const selectedLights = Object.entries(this.selectedLights).filter((light) => light[1]).map((light) => light[0])
if (!selectedLights.length) { if (!selectedLights.length) {
this.warn('No lights have been selected') this.notifyWarning('No lights have been selected')
return return
} }

View file

@ -8,14 +8,14 @@ export default {
bus.emit('notification-create', notification) bus.emit('notification-create', notification)
}, },
warn(msg) { notifyWarning(msg) {
this.notify({ this.notify({
text: msg, text: msg,
warning: true, warning: true,
}) })
}, },
error(msg) { notifyError(msg) {
this.notify({ this.notify({
text: msg, text: msg,
error: true, error: true,

View file

@ -106,7 +106,7 @@ export default {
const template = (await this.request('config.get_dashboard', { name: name })) const template = (await this.request('config.get_dashboard', { name: name }))
if (!template) { if (!template) {
this.error(`Dashboard ${name} not found`) this.notifyError(`Dashboard ${name} not found`)
} }
this.parseTemplate(name, template) this.parseTemplate(name, template)