Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pdf upload and pdf download from search results #6984

Merged
merged 3 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion app/screens/home/search/results/file_options/toasts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion app/utils/file/file_picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions ios/Mattermost.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -1531,15 +1531,15 @@
/* 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 = {
branch = 8.0.0;
kind = branch;
};
};
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph" */ = {
7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph.git" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/satoshi-takano/OpenGraph.git";
requirement = {
Expand All @@ -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 */ = {
Expand All @@ -1574,7 +1574,7 @@
};
7FD4822B2864D73300A5B18B /* OpenGraph */ = {
isa = XCSwiftPackageProductDependency;
package = 7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph" */;
package = 7FD4822A2864D73300A5B18B /* XCRemoteSwiftPackageReference "OpenGraph.git" */;
productName = OpenGraph;
};
/* End XCSwiftPackageProductDependency section */
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,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):
Expand Down Expand Up @@ -940,7 +940,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
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down