[MM-26489] No need to decode file URI on Android (#4610)

* Encode lone % chars

* No need to decode on Android
This commit is contained in:
Miguel Alatzar 2020-07-24 11:42:00 -07:00 committed by GitHub
parent ef7db846f7
commit 7c827fe319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -68,8 +68,10 @@ export default class FileQuickAction extends PureComponent {
}
}
// Decode file uri to get the actual path
res.uri = decodeURIComponent(res.uri);
if (Platform.OS === 'ios') {
// Decode file uri to get the actual path
res.uri = decodeURIComponent(res.uri);
}
this.props.onUploadFiles([res]);
} catch (error) {

View file

@ -1,7 +1,11 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {generateId, getLocalFilePathFromFile, getExtensionFromContentDisposition} from 'app/utils/file';
import {
generateId,
getLocalFilePathFromFile,
getExtensionFromContentDisposition,
} from 'app/utils/file';
describe('getExtensionFromContentDisposition', () => {
it('should return the extracted the extension', () => {