ha: always apply lazy icons to triggers

pull/3375/head
Rob Pilling 2024-04-21 19:29:01 +01:00
parent 0a097dd031
commit 3c2e6725fa
1 changed files with 12 additions and 12 deletions

View File

@ -40,6 +40,9 @@ exports.getTriggers = function(){
try{ try{
triggers = require("Storage").read("ha.trigger.json"); triggers = require("Storage").read("ha.trigger.json");
triggers = JSON.parse(triggers); triggers = JSON.parse(triggers);
} catch(e) {
// In case there are no user triggers yet, we show the default...
}
// We lazy load all icons, otherwise, we have to keep // We lazy load all icons, otherwise, we have to keep
// all the icons n times in memory which can be // all the icons n times in memory which can be
@ -51,9 +54,6 @@ exports.getTriggers = function(){
return _getIcon(trigger); return _getIcon(trigger);
} }
}) })
} catch(e) {
// In case there are no user triggers yet, we show the default...
}
return triggers; return triggers;
} }