Page MenuHomePhabricator

D13724.id45221.diff
No OneTemporary

D13724.id45221.diff

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: Alert.alert,
});
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

Mime Type
text/plain
Expires
Fri, Nov 22, 10:28 PM (15 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2565954
Default Alt Text
D13724.id45221.diff (1 KB)

Event Timeline