Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Continue to next config level after device for features
Browse files Browse the repository at this point in the history
This ensures we continue checking further config levels for the feature setting
if nothing is found when reading the device level. For example, this means the
feature setting's default value can be used.
  • Loading branch information
jryans committed Jul 17, 2019
1 parent 3801f0b commit 202f6fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/settings/handlers/DeviceSettingsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ export default class DeviceSettingsHandler extends SettingsHandler {
}

const value = localStorage.getItem("mx_labs_feature_" + featureName);
return value === "true";
if (value === "true") return true;
if (value === "false") return false;
// Try to read the next config level for the feature.
return null;
}

_writeFeature(featureName, enabled) {
Expand Down

0 comments on commit 202f6fb

Please sign in to comment.