From f96eba5db52403b6dbe7af70161e1931a4eec3e8 Mon Sep 17 00:00:00 2001 From: RadAzzouz Date: Tue, 9 Feb 2021 11:36:02 -0500 Subject: [PATCH 1/2] Disable the `autosaveEnabled` configuration option when disabling autosave via the `disableAutomaticSaving` prop --- ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m b/ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m index 32742de1..7e063ab2 100644 --- a/ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m +++ b/ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m @@ -98,7 +98,15 @@ @implementation RCTPSPDFKitViewManager RCT_EXPORT_VIEW_PROPERTY(disableDefaultActionForTappedAnnotations, BOOL) -RCT_EXPORT_VIEW_PROPERTY(disableAutomaticSaving, BOOL) +RCT_CUSTOM_VIEW_PROPERTY(disableAutomaticSaving, BOOL, RCTPSPDFKitView) { + if (json) { + view.disableAutomaticSaving = [RCTConvert BOOL:json]; + [view.pdfController updateConfigurationWithBuilder:^(PSPDFConfigurationBuilder *builder) { + // Disable autosave in the configuration. + builder.autosaveEnabled = !view.disableAutomaticSaving; + }]; + } +} RCT_REMAP_VIEW_PROPERTY(color, tintColor, UIColor) From ae027329b5380906fa778354945178c7e92730a4 Mon Sep 17 00:00:00 2001 From: RadAzzouz Date: Tue, 9 Feb 2021 12:00:47 -0500 Subject: [PATCH 2/2] Bump version to 1.30.7 --- package-lock.json | 2 +- package.json | 2 +- samples/Catalog/package.json | 2 +- samples/NativeCatalog/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index dcf3a58d..a2ccfcd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-native-pspdfkit", - "version": "1.30.6", + "version": "1.30.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4439ea09..a5d60390 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-pspdfkit", - "version": "1.30.6", + "version": "1.30.7", "description": "A React Native module for the PSPDFKit library.", "keywords": [ "react native", diff --git a/samples/Catalog/package.json b/samples/Catalog/package.json index ed5c5c1d..096ef281 100644 --- a/samples/Catalog/package.json +++ b/samples/Catalog/package.json @@ -1,6 +1,6 @@ { "name": "Catalog", - "version": "1.30.6", + "version": "1.30.7", "private": true, "scripts": { "start": "react-native start", diff --git a/samples/NativeCatalog/package.json b/samples/NativeCatalog/package.json index 7414970c..110232a2 100644 --- a/samples/NativeCatalog/package.json +++ b/samples/NativeCatalog/package.json @@ -1,6 +1,6 @@ { "name": "NativeCatalog", - "version": "1.30.6", + "version": "1.30.7", "private": true, "scripts": { "android": "react-native run-android",