Fix pdf upload and pdf download from search results (#6984)

This commit is contained in:
Daniel Espino García 2023-01-27 08:10:05 +01:00 committed by GitHub
parent a44074247e
commit 78944554a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 25 deletions

View file

@ -27,24 +27,24 @@ const OptionMenus = ({
const isTablet = useIsTablet();
const intl = useIntl();
const handleDownload = useCallback(() => {
const handleDownload = useCallback(async () => {
if (!isTablet) {
dismissBottomSheet();
await dismissBottomSheet();
}
setAction('downloading');
}, [setAction]);
const handleCopyLink = useCallback(() => {
const handleCopyLink = useCallback(async () => {
if (!isTablet) {
dismissBottomSheet();
await dismissBottomSheet();
}
setAction('copying');
}, [setAction]);
const handlePermalink = useCallback(() => {
const handlePermalink = useCallback(async () => {
if (fileInfo.post_id) {
if (!isTablet) {
dismissBottomSheet();
await dismissBottomSheet();
}
showPermalink(serverUrl, '', fileInfo.post_id);
setAction('opening');

View file

@ -17,7 +17,7 @@ const Toasts = ({
fileInfo,
setAction,
}: Props) => {
const galleryItem = {...fileInfo, type: 'image'} as GalleryItemType;
const galleryItem = {...fileInfo, type: fileInfo?.mime_type.startsWith('image/') ? 'image' : 'file'} as GalleryItemType;
switch (action) {
case 'downloading':

View file

@ -227,10 +227,10 @@ export default class FilePickerUtil {
let uri: string = doc.uri;
if (Platform.OS === 'android') {
// For android we need to retrieve the realPath in case the file being imported is from the cloud
if (doc.fileCopyUri) {
uri = doc.fileCopyUri;
} else {
// For android we need to retrieve the realPath in case the file being imported is from the cloud
const newUri = await MattermostManaged.getFilePath(doc.uri);
uri = newUri?.filePath;
if (uri === undefined) {

View file

@ -806,8 +806,8 @@
);
mainGroup = 83CBB9F61A601CBA00E9B192;
packageReferences = (
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph" */,
27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph.git" */,
27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa.git" */,
);
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
@ -1531,7 +1531,7 @@
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa.git" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
requirement = {
@ -1539,7 +1539,7 @@
kind = branch;
};
};
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph" */ = {
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph.git" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/satoshi-takano/OpenGraph.git";
requirement = {
@ -1552,12 +1552,12 @@
/* Begin XCSwiftPackageProductDependency section */
27C667A229523ECA00E590D5 /* Sentry */ = {
isa = XCSwiftPackageProductDependency;
package = 27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
package = 27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa.git" */;
productName = Sentry;
};
27C667A429523F0A00E590D5 /* Sentry */ = {
isa = XCSwiftPackageProductDependency;
package = 27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
package = 27C667A129523ECA00E590D5 /* XCRemoteSwiftPackageReference "sentry-cocoa.git" */;
productName = Sentry;
};
49AE370026D4455D00EF4E52 /* Gekidou */ = {
@ -1574,7 +1574,7 @@
};
7FD4822B2864D73300A5B18B /* OpenGraph */ = {
isa = XCSwiftPackageProductDependency;
package = 7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph" */;
package = 7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph.git" */;
productName = OpenGraph;
};
/* End XCSwiftPackageProductDependency section */

View file

@ -360,7 +360,7 @@ PODS:
- SwiftyJSON (~> 5.0)
- react-native-notifications (4.3.3):
- React-Core
- react-native-paste-input (0.6.0):
- react-native-paste-input (0.6.1):
- React-Core
- Swime (= 3.0.6)
- react-native-safe-area-context (4.5.0):
@ -944,7 +944,7 @@ SPEC CHECKSUMS:
react-native-netinfo: 2517ad504b3d303e90d7a431b0fcaef76d207983
react-native-network-client: 88b7ef8ef937352db3cfdbea939dc55397c64b9f
react-native-notifications: 83b4fd4a127a6c918fc846cae90da60f84819e44
react-native-paste-input: 5182843692fd2ec72be50f241a38a49796e225d7
react-native-paste-input: fb7156dc75960c9895ddd9b9d68eeb874c9f323a
react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc
react-native-turbo-mailer: fa3f18b5a274fa32ebe43af125caf041f7cc4cbf
react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253

14
package-lock.json generated
View file

@ -20,7 +20,7 @@
"@mattermost/compass-icons": "0.1.35",
"@mattermost/react-native-emm": "1.3.4",
"@mattermost/react-native-network-client": "1.1.0",
"@mattermost/react-native-paste-input": "0.6.0",
"@mattermost/react-native-paste-input": "0.6.1",
"@mattermost/react-native-turbo-log": "0.2.2",
"@mattermost/react-native-turbo-mailer": "0.2.3",
"@msgpack/msgpack": "2.8.0",
@ -3254,9 +3254,9 @@
}
},
"node_modules/@mattermost/react-native-paste-input": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/react-native-paste-input/-/react-native-paste-input-0.6.0.tgz",
"integrity": "sha512-Hy4w8RaiiXl2AKcLXT0FjJJsh4FXtLiWCxfh6zaBtCkx7jsr4d9xwJ/zqrnjv0jkG7XbRUCp40dgNBpWYZ1pyQ==",
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@mattermost/react-native-paste-input/-/react-native-paste-input-0.6.1.tgz",
"integrity": "sha512-622pc7+h+HNFxhOYuHfXG72D1EmjA+84lsDVKITB01IfE4F0xQYyT1LlCr0GVgUePUI5TXMv6xA1j4izAN+jQQ==",
"dependencies": {
"semver": "7.3.8"
},
@ -24302,9 +24302,9 @@
}
},
"@mattermost/react-native-paste-input": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/react-native-paste-input/-/react-native-paste-input-0.6.0.tgz",
"integrity": "sha512-Hy4w8RaiiXl2AKcLXT0FjJJsh4FXtLiWCxfh6zaBtCkx7jsr4d9xwJ/zqrnjv0jkG7XbRUCp40dgNBpWYZ1pyQ==",
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@mattermost/react-native-paste-input/-/react-native-paste-input-0.6.1.tgz",
"integrity": "sha512-622pc7+h+HNFxhOYuHfXG72D1EmjA+84lsDVKITB01IfE4F0xQYyT1LlCr0GVgUePUI5TXMv6xA1j4izAN+jQQ==",
"requires": {
"semver": "7.3.8"
}

View file

@ -17,7 +17,7 @@
"@mattermost/compass-icons": "0.1.35",
"@mattermost/react-native-emm": "1.3.4",
"@mattermost/react-native-network-client": "1.1.0",
"@mattermost/react-native-paste-input": "0.6.0",
"@mattermost/react-native-paste-input": "0.6.1",
"@mattermost/react-native-turbo-log": "0.2.2",
"@mattermost/react-native-turbo-mailer": "0.2.3",
"@msgpack/msgpack": "2.8.0",