Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
chore: upgrade snjs; fixes #619
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed May 19, 2022
1 parent bf1dccc commit 0bc6762
Show file tree
Hide file tree
Showing 6 changed files with 579 additions and 212 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "standardnotes-mobile",
"version": "3.20.0",
"user-version": "3.20.0",
"version": "3.20.1",
"user-version": "3.20.1",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand All @@ -19,7 +19,8 @@
"start": "react-native start",
"test": "jest",
"postinstall": "patch-package && yarn run ncu",
"android:bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/"
"android:bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/",
"upgrade:snjs": "ncu -u '@standardnotes/*' && yarn"
},
"resolutions": {
"@types/react": "^17",
Expand All @@ -34,12 +35,12 @@
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "^6.2.1",
"@standardnotes/components": "^1.8.1",
"@standardnotes/filepicker": "^1.14.7",
"@standardnotes/filepicker": "^1.14.9",
"@standardnotes/react-native-aes": "^1.4.3",
"@standardnotes/react-native-textview": "1.0.2",
"@standardnotes/react-native-utils": "1.0.1",
"@standardnotes/sncrypto-common": "1.8.2",
"@standardnotes/snjs": "2.109.0",
"@standardnotes/snjs": "2.109.6",
"@standardnotes/stylekit": "5.26.0",
"@types/styled-components-react-native": "5.1.3",
"js-base64": "^3.7.2",
Expand Down
14 changes: 7 additions & 7 deletions src/Lib/ApplicationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ export class ApplicationState extends ApplicationService {
: this.selectedTag.uuid
: undefined

this.application.editorGroup.closeActiveNoteView()
this.application.editorGroup.closeActiveNoteController()

const noteView = await this.application.editorGroup.createNoteView(undefined, title, selectedTagUuid)
const noteView = await this.application.editorGroup.createNoteController(undefined, title, selectedTagUuid)

const defaultEditor = this.application.componentManager.getDefaultEditor()
if (defaultEditor) {
Expand All @@ -281,10 +281,10 @@ export class ApplicationState extends ApplicationService {
const note = this.application.items.findItem(noteUuid) as SNNote
const activeEditor = this.getActiveNoteController()
if (activeEditor) {
this.application.editorGroup.closeActiveNoteView()
this.application.editorGroup.closeActiveNoteController()
}

const noteView = await this.application.editorGroup.createNoteView(noteUuid)
const noteView = await this.application.editorGroup.createNoteController(noteUuid)

if (note && note.conflictOf) {
void InteractionManager.runAfterInteractions(() => {
Expand All @@ -307,17 +307,17 @@ export class ApplicationState extends ApplicationService {

closeEditor(editor: NoteViewController) {
this.notifyOfStateChange(AppStateType.EditorClosed)
this.application.editorGroup.closeNoteView(editor)
this.application.editorGroup.closeNoteController(editor)
}

closeActiveEditor() {
this.notifyOfStateChange(AppStateType.EditorClosed)
this.application.editorGroup.closeActiveNoteView()
this.application.editorGroup.closeActiveNoteController()
}

closeAllEditors() {
this.notifyOfStateChange(AppStateType.EditorClosed)
this.application.editorGroup.closeAllNoteViews()
this.application.editorGroup.closeAllNoteControllers()
}

editorForNote(uuid: Uuid): NoteViewController | void {
Expand Down
4 changes: 2 additions & 2 deletions src/Lib/ComponentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export class ComponentManager extends SNComponentManager {
} catch (e) {
void this.alertService.alert(
'Unable to start component server. ' +
'Editors other than the Plain Editor will fail to load. ' +
'Please restart the app and try again.'
'Editors other than the Plain Editor will fail to load. ' +
'Please restart the app and try again.'
)
SNLog.error(e as any)
}
Expand Down
8 changes: 8 additions & 0 deletions src/Lib/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ export class MobileDeviceInterface implements DeviceInterface {
.catch(() => showAlert())
}

async clearAllDataFromDevice(_workspaceIdentifiers: string[]): Promise<{ killsApplication: boolean }> {
await this.clearRawKeychainValue()

await this.removeAllRawStorageValues()

return { killsApplication: false }
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
performSoftReset() {}

Expand Down
8 changes: 5 additions & 3 deletions src/Screens/SideMenu/NoteSideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSafeApplicationContext } from '@Root/Hooks/useSafeApplicationContext
import { SCREEN_COMPOSE, SCREEN_INPUT_MODAL_TAG, SCREEN_NOTE_HISTORY } from '@Root/Screens/screens'
import { Files } from '@Root/Screens/SideMenu/Files'
import { Listed } from '@Root/Screens/SideMenu/Listed'
import { FeatureIdentifier } from '@standardnotes/features'
import { FeatureIdentifier, FindNativeFeature } from '@standardnotes/features'
import {
ApplicationEvent,
ButtonType,
Expand Down Expand Up @@ -49,7 +49,9 @@ import { TagSelectionList } from './TagSelectionList'

function sortAlphabetically(array: SNComponent[]): SNComponent[] {
return array.sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
const aName = FindNativeFeature(a.identifier)?.name || a.name
const bName = FindNativeFeature(b.identifier)?.name || b.name
return aName.toLowerCase() < bName.toLowerCase() ? -1 : 1
})
}

Expand Down Expand Up @@ -376,7 +378,7 @@ export const NoteSideMenu = React.memo((props: Props) => {
]
components.map(component => {
options.push({
text: component.name,
text: FindNativeFeature(component.identifier)?.name || component.name,
subtext: component.isMobileDefault ? 'Mobile Default' : undefined,
key: component.uuid || component.name,
selected: component.uuid === componentEditor?.uuid,
Expand Down

0 comments on commit 0bc6762

Please sign in to comment.