diff --git a/package.json b/package.json index 673a683a..85ef2bfb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "standardnotes-mobile", - "version": "3.12.0", - "user-version": "3.12.0", + "version": "3.12.1", + "user-version": "3.12.1", "private": true, "license": "AGPL-3.0-or-later", "scripts": { diff --git a/src/screens/Compose/Compose.tsx b/src/screens/Compose/Compose.tsx index 1a52a45f..b86d9b8f 100644 --- a/src/screens/Compose/Compose.tsx +++ b/src/screens/Compose/Compose.tsx @@ -3,6 +3,7 @@ import { ComponentLoadingError } from '@Lib/component_manager'; import { isNullOrUndefined } from '@Lib/utils'; import { ApplicationContext } from '@Root/ApplicationContext'; import { SCREEN_COMPOSE } from '@Screens/screens'; +import SNTextView from '@standardnotes/react-native-textview'; import { ApplicationEvent, ComponentMutator, @@ -21,7 +22,6 @@ import { lighten } from '@Style/utils'; import React, { createRef } from 'react'; import { Keyboard, Platform, View } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; -import SNTextView from '@standardnotes/react-native-textview'; import { ThemeContext } from 'styled-components'; import { ComponentView } from './ComponentView'; import { @@ -53,6 +53,9 @@ type State = { componentViewer?: ComponentViewer; }; +const EditingIsDisabledText = + 'This note has editing disabled. Please enable editing on this note to make changes.'; + export class Compose extends React.Component<{}, State> { static contextType = ApplicationContext; context: React.ContextType; @@ -412,6 +415,10 @@ export class Compose extends React.Component<{}, State> { }; onTitleChange = (newTitle: string) => { + if (this.note?.locked) { + this.context?.alertService?.alert(EditingIsDisabledText); + return; + } this.setState( { title: newTitle, @@ -422,9 +429,7 @@ export class Compose extends React.Component<{}, State> { onContentChange = (text: string) => { if (this.note?.locked) { - this.context?.alertService?.alert( - 'This note has editing disabled. Please enable editing on this note to make changes.' - ); + this.context?.alertService?.alert(EditingIsDisabledText); return; } this.saveNote(false, true, false, false, text); @@ -556,7 +561,6 @@ export class Compose extends React.Component<{}, State> { keyboardAppearance={themeService?.keyboardColorForActiveTheme()} autoCorrect={true} autoCapitalize={'sentences'} - editable={!this.noteLocked} /> {(this.state.downloadingEditor || (this.state.loadingWebview &&