Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3393297
D7966.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7966.diff
View Options
diff --git a/native/dev-menu.js b/native/dev-menu.js
new file mode 100644
--- /dev/null
+++ b/native/dev-menu.js
@@ -0,0 +1,28 @@
+// @flow
+
+import { registerDevMenuItems } from 'expo-dev-menu';
+import { Alert } from 'react-native';
+
+import { getMessageForException } from 'lib/utils/errors.js';
+
+import { filesystemMediaCache } from './media/media-cache.js';
+
+// see https://docs.expo.dev/develop/development-builds/development-workflows/#extending-the-dev-menu
+// for details on extending the dev menu
+if (__DEV__) {
+ const devMenuItems = [
+ {
+ name: 'Clear media cache',
+ callback: async () => {
+ try {
+ await filesystemMediaCache.clearCache();
+ Alert.alert('Media cache cleared');
+ } catch (e) {
+ Alert.alert('Cache clear failed', getMessageForException(e));
+ }
+ },
+ },
+ ];
+
+ registerDevMenuItems(devMenuItems);
+}
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -57,6 +57,9 @@
import ThemeHandler from './themes/theme-handler.react.js';
import { provider } from './utils/ethers-utils.js';
+// Add custom items to expo-dev-menu
+import './dev-menu.js';
+
if (Platform.OS === 'android') {
UIManager.setLayoutAnimationEnabledExperimental &&
UIManager.setLayoutAnimationEnabledExperimental(true);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 1:02 PM (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2605055
Default Alt Text
D7966.diff (1 KB)
Attached To
Mode
D7966: [native] Add "Clear media cache" button to dev menu
Attached
Detach File
Event Timeline
Log In to Comment