diff --git a/android/app/build.gradle b/android/app/build.gradle
index 05c8aa92..b0b05c95 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -97,8 +97,8 @@ android {
applicationId "com.standardnotes"
minSdkVersion 21
targetSdkVersion 25
- versionCode 2010320
- versionName "2.1.32"
+ versionCode 2010330
+ versionName "2.1.33"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
diff --git a/ios/StandardNotes/Info.plist b/ios/StandardNotes/Info.plist
index b6009dc4..fe06c265 100644
--- a/ios/StandardNotes/Info.plist
+++ b/ios/StandardNotes/Info.plist
@@ -19,11 +19,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 2.1.32
+ 2.1.33
CFBundleSignature
????
CFBundleVersion
- 1
+ 2
LSRequiresIPhoneOS
NSAppTransportSecurity
diff --git a/package.json b/package.json
index 074534d2..f97cd449 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
"name": "StandardNotes",
- "version": "2.1.32",
- "versionIOS": "2.1.32",
- "versionAndroid": "2.1.32",
+ "version": "2.1.33",
+ "versionIOS": "2.1.33",
+ "versionAndroid": "2.1.33",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
diff --git a/src/lib/componentManager.js b/src/lib/componentManager.js
index 7ac662d3..453318f2 100644
--- a/src/lib/componentManager.js
+++ b/src/lib/componentManager.js
@@ -167,6 +167,12 @@ export default class ComponentManager {
return _.find(this.components, {sessionKey: key});
}
+ isReadOnlyMessage(message) {
+ let writeActions = ["save-items", "delete-items", "create-item"]
+ // Ensure the message action is not one of the writeActions
+ return !writeActions.includes(message.action);
+ }
+
handleMessage(component, message) {
if(!component) {
diff --git a/src/screens/Webview.js b/src/screens/Webview.js
index 58de0b70..c7560324 100644
--- a/src/screens/Webview.js
+++ b/src/screens/Webview.js
@@ -97,7 +97,10 @@ export default class Webview extends Abstract {
}
dismiss() {
- this.props.navigator.dismissModal({animationType: "slide-down"})
+ // There is an issue on iOS where if this modal is dismissed with an animation, and the user presses "Manage" too quickly, the navigation stack will go into an invalid state.
+ // So, no animation on iOS, but slide-down on Android
+ let animationType = App.isIOS ? "none" : "slide-down";
+ this.props.navigator.dismissModal({animationType: animationType})
}
configureNavBar() {
@@ -115,7 +118,17 @@ export default class Webview extends Abstract {
}
onMessage = (message) => {
+ // Ignore any incoming events (like save events) if the note is locked. Allow messages that are required for component setup (administrative)
let data = JSON.parse(message.nativeEvent.data);
+
+ if(this.note.locked && !ComponentManager.get().isReadOnlyMessage(data)) {
+ if(!this.didShowLockAlert) {
+ Alert.alert('Note Locked', "This note is locked. Changes you make in the web editor will not be saved. Please unlock this note to make changes.", [{text: 'OK'}])
+ this.didShowLockAlert = true;
+ }
+ this.setNavBarSubtitle("Note Locked");
+ return;
+ }
ComponentManager.get().handleMessage(this.editor, data);
}