Skip to content

Commit

Permalink
Fix possible bug when using config before opening the plasmoid
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuchs committed Jan 22, 2017
1 parent 3853f51 commit 1d2257f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package/contents/code/hue.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ function isInitialized () {
* @return {bool} True if auth and bridge are set, otherwise false
*/
function getHueConfigured() {
if(!isInitialized()) {
initHueConfig();
}

var base = plasmoid.configuration.baseURL
var auth = plasmoid.configuration.authToken
if(!base || !auth) {
// something went terribly wrong here
return false;
}
if (!base.trim() || !auth.trim()) {
// is empty or whitespace
return false;
Expand Down
3 changes: 3 additions & 0 deletions package/contents/ui/configActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ Item {
}

Component.onCompleted: {
if(!Hue.isInitialized()) {
Hue.initHueConfig();
}
actionListModel.clear();

try {
Expand Down

0 comments on commit 1d2257f

Please sign in to comment.