This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C-2851] Add privacy policy to settings page (#3741)
- Loading branch information
1 parent
bb67f44
commit 9468b70
Showing
10 changed files
with
109 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,7 @@ | ||
import { FeatureFlags } from '@audius/common' | ||
import AsyncStorage from '@react-native-async-storage/async-storage' | ||
import { useAsync } from 'react-use' | ||
|
||
import { useFeatureFlag } from './useRemoteConfig' | ||
|
||
const OFFLINE_OVERRIDE_ASYNC_STORAGE_KEY = 'offline_mode_release_local_override' | ||
|
||
// DO NOT CHECK IN VALUE: true | ||
const hardCodeOverride = false | ||
let asyncOverride = false | ||
|
||
export const toggleLocalOfflineModeOverride = () => { | ||
asyncOverride = !asyncOverride | ||
AsyncStorage.setItem( | ||
OFFLINE_OVERRIDE_ASYNC_STORAGE_KEY, | ||
asyncOverride.toString() | ||
) | ||
alert(`Offline mode ${asyncOverride ? 'enabled' : 'disabled'}`) | ||
} | ||
|
||
export const useReadOfflineOverride = () => | ||
useAsync(async () => { | ||
try { | ||
asyncOverride = | ||
(await AsyncStorage.getItem(OFFLINE_OVERRIDE_ASYNC_STORAGE_KEY)) === | ||
'true' | ||
} catch (e) { | ||
console.log('error reading local offline mode override') | ||
} | ||
}) | ||
|
||
// TODO: remove helpers when feature is shipped | ||
export const useIsOfflineModeEnabled = () => | ||
useFeatureFlag(FeatureFlags.OFFLINE_MODE_RELEASE).isEnabled || | ||
asyncOverride || | ||
hardCodeOverride | ||
useFeatureFlag(FeatureFlags.OFFLINE_MODE_RELEASE).isEnabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.