Convert feature setting usages to regular settings
This commit is contained in:
parent
c91fc99d4b
commit
96087d61f6
25 changed files with 30 additions and 101 deletions
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue