Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33511189
D10036.1769063876.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1016 B
Referenced Files
None
Subscribers
None
D10036.1769063876.diff
View Options
diff --git a/native/utils/android-permissions.js b/native/utils/android-permissions.js
--- a/native/utils/android-permissions.js
+++ b/native/utils/android-permissions.js
@@ -10,18 +10,19 @@
type PermissionsResult = { +[permission: string]: boolean };
+const emptyObj: PermissionsResult = {};
+
async function getAndroidPermissions(
permissions: Array<string>,
checkOrRequest: CheckOrRequest,
throwExceptions?: ThrowExceptions,
): Promise<PermissionsResult> {
- const result = {};
-
if (permissions.length === 0) {
- return result;
+ return emptyObj;
}
if (checkOrRequest === 'check') {
+ const result: { [string]: Promise<boolean> } = {};
for (const permission of permissions) {
result[permission] = (async () => {
try {
@@ -47,6 +48,8 @@
throw e;
}
}
+
+ const result: { [string]: boolean } = {};
for (const permission of permissions) {
result[permission] =
requestResult[permission] === PermissionsAndroid.RESULTS.GRANTED;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 22, 6:37 AM (5 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5956964
Default Alt Text
D10036.1769063876.diff (1016 B)
Attached To
Mode
D10036: [Flow202][native][skip-ci] [52/x] Separate results obj instantiation in android-permissions.js
Attached
Detach File
Event Timeline
Log In to Comment