Skip to content

Commit

Permalink
update camera roll (keybase#24258)
Browse files Browse the repository at this point in the history
* update cam roll

* WIP
  • Loading branch information
chrisnojima authored Jul 9, 2020
1 parent 55ed476 commit fd80286
Show file tree
Hide file tree
Showing 145 changed files with 8,319 additions and 6,800 deletions.
1 change: 0 additions & 1 deletion shared/actions/platform-specific/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare function showShareActionSheet(options: {
method: string
}>

export declare function saveAttachmentDialog(filePath: string): Promise<NextURI>
export declare function saveAttachmentToCameraRoll(fileURL: string, mimeType: string): Promise<void>
export declare function requestLocationPermission(mode: RPCChatTypes.UIWatchPositionPerm): Promise<void>
export declare function requestAudioPermission(): Promise<void>
Expand Down
3 changes: 0 additions & 3 deletions shared/actions/platform-specific/index.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const {argv, env, pid} = KB.process
export function showShareActionSheet() {
throw new Error('Show Share Action - unsupported on this platform')
}
export function saveAttachmentDialog() {
throw new Error('Save Attachment - unsupported on this platform')
}
export async function saveAttachmentToCameraRoll() {
throw new Error('Save Attachment to camera roll - unsupported on this platform')
}
Expand Down
11 changes: 2 additions & 9 deletions shared/actions/platform-specific/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,14 @@ export const requestLocationPermission = async (mode: RPCChatTypes.UIWatchPositi
}
}

export const saveAttachmentDialog = async (filePath: string) => {
const goodPath = filePath
logger.debug('saveAttachment: ', goodPath)
await requestPermissionsToWrite()
return CameraRoll.saveToCameraRoll(goodPath)
}

export async function saveAttachmentToCameraRoll(filePath: string, mimeType: string): Promise<void> {
const fileURL = 'file://' + filePath
const saveType = mimeType.startsWith('video') ? 'video' : 'photo'
const saveType: 'video' | 'photo' = mimeType.startsWith('video') ? 'video' : 'photo'
const logPrefix = '[saveAttachmentToCameraRoll] '
try {
await requestPermissionsToWrite()
logger.info(logPrefix + `Attempting to save as ${saveType}`)
await CameraRoll.saveToCameraRoll(fileURL, saveType)
await CameraRoll.save(fileURL, {type: saveType})
logger.info(logPrefix + 'Success')
} catch (e) {
// This can fail if the user backgrounds too quickly, so throw up a local notification
Expand Down
6 changes: 3 additions & 3 deletions shared/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ PODS:
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsinspector (0.61.5)
- react-native-cameraroll (1.2.1):
- react-native-cameraroll (4.0.0):
- React
- react-native-contacts (5.1.0):
- React
Expand Down Expand Up @@ -579,7 +579,7 @@ SPEC CHECKSUMS:
React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
react-native-cameraroll: 3e5e34d36d93548ae7770ee8ab7b2ae9e778f571
react-native-cameraroll: ae0a7c0cc8462508855707ff623b1e789b692865
react-native-contacts: be6cde1ffc9c0196fbb57d987b9d40f12b85989c
react-native-geolocation: c956aeb136625c23e0dce0467664af2c437888c9
react-native-hw-keyboard-event: b517cefb8d5c659a38049c582de85ff43337dc53
Expand Down Expand Up @@ -622,4 +622,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 843dc6df133334007d13b5c34a0fd83194e7fa0e

COCOAPODS: 1.8.4
COCOAPODS: 1.9.1

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

6 changes: 3 additions & 3 deletions shared/ios/Pods/Manifest.lock

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

13,684 changes: 6,910 additions & 6,774 deletions shared/ios/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading

0 comments on commit fd80286

Please sign in to comment.