diff --git a/package.json b/package.json index 41d3ec59..51710978 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@react-navigation/native": "^5.9.3", "@react-navigation/stack": "^5.14.3", "@standardnotes/sncrypto-common": "1.2.9", - "@standardnotes/snjs": "2.0.72", + "@standardnotes/snjs": "2.0.75", "js-base64": "^3.5.2", "moment": "^2.29.1", "react": "16.13.1", diff --git a/src/screens/Compose/Compose.tsx b/src/screens/Compose/Compose.tsx index 7e1ec663..6086e3d2 100644 --- a/src/screens/Compose/Compose.tsx +++ b/src/screens/Compose/Compose.tsx @@ -87,7 +87,12 @@ export class Compose extends React.Component<{}, State> { { title: newNote.title, }, - () => this.reloadComponentEditorState() + () => { + this.reloadComponentEditorState(); + if (newNote.dirty) { + this.showSavingStatus(); + } + } ); } ); @@ -103,14 +108,15 @@ export class Compose extends React.Component<{}, State> { this.setState({ title: newNote.title }); } - if (newNote.lastSyncBegan) { + if (newNote.lastSyncBegan || newNote.dirty) { if (newNote.lastSyncEnd) { if ( - newNote.lastSyncBegan?.getTime() > newNote.lastSyncEnd.getTime() + newNote.dirty || + newNote.lastSyncBegan!.getTime() > newNote.lastSyncEnd.getTime() ) { this.showSavingStatus(); } else if ( - newNote.lastSyncEnd.getTime() > newNote.lastSyncBegan.getTime() + newNote.lastSyncEnd.getTime() > newNote.lastSyncBegan!.getTime() ) { this.showAllChangesSavedStatus(); } diff --git a/src/screens/NoteHistory/SessionHistory.tsx b/src/screens/NoteHistory/SessionHistory.tsx index 4a2ac7c6..fa46d2c1 100644 --- a/src/screens/NoteHistory/SessionHistory.tsx +++ b/src/screens/NoteHistory/SessionHistory.tsx @@ -1,5 +1,5 @@ import { ApplicationContext } from '@Root/ApplicationContext'; -import { ItemSessionHistory, SNNote } from '@standardnotes/snjs'; +import { HistoryEntry, SNNote } from '@standardnotes/snjs'; import { NoteHistoryEntry } from '@standardnotes/snjs/dist/@types/services/history/entries/note_history_entry'; import React, { useCallback, useContext, useEffect, useState } from 'react'; import { FlatList, ListRenderItem } from 'react-native'; @@ -16,7 +16,7 @@ export const SessionHistory: React.FC = ({ note, onPress }) => { const insets = useSafeAreaInsets(); // State - const [sessionHistory, setSessionHistory] = useState(); + const [sessionHistory, setSessionHistory] = useState(); useEffect(() => { if (note) { @@ -52,7 +52,7 @@ export const SessionHistory: React.FC = ({ note, onPress }) => { initialNumToRender={10} windowSize={10} keyboardShouldPersistTaps={'never'} - data={sessionHistory?.entries as NoteHistoryEntry[]} + data={sessionHistory as NoteHistoryEntry[]} renderItem={RenderItem} /> ); diff --git a/src/screens/SideMenu/NoteSideMenu.tsx b/src/screens/SideMenu/NoteSideMenu.tsx index c9e12bc9..62465e79 100644 --- a/src/screens/SideMenu/NoteSideMenu.tsx +++ b/src/screens/SideMenu/NoteSideMenu.tsx @@ -235,6 +235,12 @@ export const NoteSideMenu = React.memo((props: Props) => { const onEditorPress = useCallback( async (selectedComponent?: SNComponent) => { + if (note?.locked) { + application?.alertService.alert( + "This note is locked. If you'd like to edit its options, unlock it, and try again." + ); + return; + } if (editor?.isTemplateNote) { await editor?.insertTemplatedNote(); } diff --git a/yarn.lock b/yarn.lock index 611352ab..bb788fce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1390,10 +1390,10 @@ resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-common/-/sncrypto-common-1.2.9.tgz#5212a959e4ec563584e42480bfd39ef129c3cbdf" integrity sha512-xJ5IUGOZztjSgNP/6XL+Ut5+q9UgSTv6xMtKkcQC5aJxCOkJy9u6RamPLdF00WQgwibxx2tu0e43bKUjTgzMig== -"@standardnotes/snjs@2.0.72": - version "2.0.72" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.72.tgz#1ff7d691f0d907a1513ec88e6b5d5ae0691f2947" - integrity sha512-OL1jeb0sEz4SZwGHeceoKttVcBmcKAh5y/96TELJxM1ZHL2Ayf6DxAXCz3KZBoD7JZllbJ9QWR37/bp+E4y2TA== +"@standardnotes/snjs@2.0.75": + version "2.0.75" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.75.tgz#aeb0ead927da63dc85e28f78da2362126bb16602" + integrity sha512-QL5YgDT0aN9t95gxgURqNudXr5dteVsc1ylsKKSw0DpEGiq0bACPxbI+sUFppoWTFmprxmDh3+vc+FFcFg7Lyw== dependencies: "@standardnotes/auth" "^2.0.0" "@standardnotes/sncrypto-common" "^1.2.9"