mirror of
https://github.com/standardnotes/mobile.git
synced 2026-04-24 08:07:00 -04:00
fix: allow copying locked note's title (#557)
* fix: allow copying locked note's title * chore: version bump
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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<typeof ApplicationContext>;
|
||||
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user