Convert feature setting usages to regular settings

This commit is contained in:
Travis Ralston 2020-08-17 13:12:18 -06:00
parent c91fc99d4b
commit 96087d61f6
25 changed files with 30 additions and 101 deletions

View file

@ -36,11 +36,11 @@ export const useSettingValue = (settingName: string, roomId: string = null, excl
// Hook to fetch whether a feature is enabled and dynamically update when that changes
export const useFeatureEnabled = (featureName: string, roomId: string = null) => {
const [enabled, setEnabled] = useState(SettingsStore.isFeatureEnabled(featureName, roomId));
const [enabled, setEnabled] = useState(SettingsStore.getValue(featureName, roomId));
useEffect(() => {
const ref = SettingsStore.watchSetting(featureName, roomId, () => {
setEnabled(SettingsStore.isFeatureEnabled(featureName, roomId));
setEnabled(SettingsStore.getValue(featureName, roomId));
});
// clean-up
return () => {