Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3518377
D13724.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
D13724.diff
View Options
diff --git a/lib/utils/__mocks__/config.js b/lib/utils/__mocks__/config.js
--- a/lib/utils/__mocks__/config.js
+++ b/lib/utils/__mocks__/config.js
@@ -56,6 +56,7 @@
getNotifByteSize: jest.fn(),
normalizeUint8ArrayForBlobUpload: jest.fn(),
},
+ showAlert: jest.fn(),
});
const hasConfig = (): boolean => true;
diff --git a/lib/utils/config.js b/lib/utils/config.js
--- a/lib/utils/config.js
+++ b/lib/utils/config.js
@@ -31,6 +31,7 @@
+olmAPI: OlmAPI,
+sqliteAPI: SQLiteAPI,
+encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI,
+ +showAlert: (title: string, message: string) => mixed,
};
let registeredConfig: ?Config = null;
diff --git a/native/config.js b/native/config.js
--- a/native/config.js
+++ b/native/config.js
@@ -1,6 +1,6 @@
// @flow
-import { Platform } from 'react-native';
+import { Alert, Platform } from 'react-native';
import { registerConfig } from 'lib/utils/config.js';
@@ -24,4 +24,5 @@
olmAPI,
sqliteAPI,
encryptedNotifUtilsAPI,
+ showAlert: (title: string, message: string) => Alert.alert(title, message),
});
diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -128,6 +128,8 @@
olmAPI,
sqliteAPI,
encryptedNotifUtilsAPI,
+ showAlert: (title: string, message: string) =>
+ window.alert(`${title}: ${message}`),
});
const versionBroadcast = new BroadcastChannel('comm_version');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 8:02 PM (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696133
Default Alt Text
D13724.diff (1 KB)
Attached To
Mode
D13724: [lib] Add an alert to the lib config
Attached
Detach File
Event Timeline
Log In to Comment