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

Commit

Permalink
Merge branch 'release/3.9.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jan 10, 2022
2 parents 40206cf + f33c11c commit ac472c5
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 353 deletions.
14 changes: 8 additions & 6 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme">
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme"
tools:targetApi="n">

<meta-data android:name="com.bugsnag.android.API_KEY"
android:value="ba1cad5922ac743322c4051f0249e999"/>
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
<domain includeSubdomains="false">127.0.0.1</domain>
</domain-config>
</network-security-config>
4 changes: 2 additions & 2 deletions ios/StandardNotes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1C2EEB3B45F4EB07AC795C77 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
1C2EEB3B45F4EB07AC795C77 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
33BB1B14071EBE5978EBF3A8 /* libPods-StandardNotes-StandardNotesTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 04FCB5A3A3387CA3CFC82AA3 /* libPods-StandardNotes-StandardNotesTests.a */; };
BC8DEA834BF198E8511F04FF /* libPods-StandardNotesDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F2D747BE02C2A1BCFEEFD1 /* libPods-StandardNotesDev.a */; };
CD7D5ECA27800609005FE1BF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD7D5EC927800608005FE1BF /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -83,7 +83,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1C2EEB3B45F4EB07AC795C77 /* (null) in Frameworks */,
1C2EEB3B45F4EB07AC795C77 /* BuildFile in Frameworks */,
DD3D1CE428EC1C8BA0C49211 /* libPods-StandardNotes.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "standardnotes-mobile",
"version": "3.9.8",
"user-version": "3.9.8",
"version": "3.9.12",
"user-version": "3.9.12",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"@standardnotes/sncrypto-common": "1.5.2",
"@standardnotes/snjs": "2.31.20",
"@standardnotes/snjs": "2.34.0",
"js-base64": "^3.5.2",
"moment": "^2.29.1",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions src/AppStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ type AppStackNavigatorParamList = {

export type AppStackNavigationProp<
T extends keyof AppStackNavigatorParamList
> = {
navigation: CompositeNavigationProp<
ModalStackNavigationProp<'AppStack'>['navigation'],
StackNavigationProp<AppStackNavigatorParamList, T>
>;
route: RouteProp<AppStackNavigatorParamList, T>;
};
> = {
navigation: CompositeNavigationProp<
ModalStackNavigationProp<'AppStack'>['navigation'],
StackNavigationProp<AppStackNavigatorParamList, T>
>;
route: RouteProp<AppStackNavigatorParamList, T>;
};

const AppStack = createStackNavigator<AppStackNavigatorParamList>();

Expand Down
6 changes: 3 additions & 3 deletions src/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ChallengeValidation,
DeinitSource,
Environment,
NoteGroupController,
platformFromString,
SNApplication,
SNComponentManager,
Expand All @@ -17,7 +18,6 @@ import { AlertService } from './alert_service';
import { ApplicationState, UnlockTiming } from './application_state';
import { BackupsService } from './backups_service';
import { ComponentManager } from './component_manager';
import { EditorGroup } from './editor_group';
import { InstallationService } from './installation_service';
import { MobileDeviceInterface } from './interface';
import { push } from './navigation_service';
Expand All @@ -39,7 +39,7 @@ const IsDev = VersionInfo.bundleIdentifier?.includes('dev');

export class MobileApplication extends SNApplication {
private MobileServices!: MobileServices;
public editorGroup: EditorGroup;
public editorGroup: NoteGroupController;
private startedDeinit: boolean = false;
public Uuid: string; // UI remounts when Uuid changes
static previouslyLaunched: boolean = false;
Expand Down Expand Up @@ -68,7 +68,7 @@ export class MobileApplication extends SNApplication {
: 'wss://sockets.standardnotes.com'
);
this.Uuid = Math.random().toString();
this.editorGroup = new EditorGroup(this);
this.editorGroup = new NoteGroupController(this);
this.mobileComponentManager.initialize(this.protocolService);
}

Expand Down
49 changes: 24 additions & 25 deletions src/lib/application_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ChallengeValidation,
ContentType,
isNullOrUndefined,
NoteViewController,
PayloadSource,
removeFromArray,
SNNote,
Expand All @@ -31,7 +32,6 @@ import { hide, show } from 'react-native-privacy-snapshot';
import VersionInfo from 'react-native-version-info';
import { MobileApplication } from './application';
import { associateComponentWithNote } from './component_manager';
import { Editor } from './editor';
import { PrefKey } from './preferences_manager';

const pjson = require('../../package.json');
Expand Down Expand Up @@ -285,35 +285,34 @@ export class ApplicationState extends ApplicationService {
? undefined
: this.selectedTag.uuid
: undefined;
let activeEditor = this.getActiveEditor();
if (!activeEditor || this.multiEditorEnabled) {
await this.application.editorGroup.createEditor(
undefined,
title,
selectedTagUuid
);
activeEditor = this.getActiveEditor();
} else {
await activeEditor.reset(title, selectedTagUuid);
}

this.application.editorGroup.closeActiveNoteView();

await this.application.editorGroup.createNoteView(
undefined,
title,
selectedTagUuid
);

const defaultEditor = this.application.componentManager.getDefaultEditor();
if (defaultEditor) {
await associateComponentWithNote(
this.application,
defaultEditor,
activeEditor.note!
this.getActiveNoteController().note!
);
}
}

async openEditor(noteUuid: string) {
const note = this.application.findItem(noteUuid) as SNNote;
const activeEditor = this.getActiveEditor();
if (!activeEditor || this.multiEditorEnabled) {
await this.application.editorGroup.createEditor(noteUuid);
} else {
activeEditor.setNote(note);
const activeEditor = this.getActiveNoteController();
if (activeEditor) {
this.application.editorGroup.closeActiveNoteView();
}

await this.application.editorGroup.createNoteView(noteUuid);

if (note && note.conflictOf) {
InteractionManager.runAfterInteractions(() => {
this.application?.changeAndSaveItem(note.uuid, mutator => {
Expand All @@ -323,27 +322,27 @@ export class ApplicationState extends ApplicationService {
}
}

getActiveEditor() {
return this.application.editorGroup.editors[0];
getActiveNoteController() {
return this.application.editorGroup.noteControllers[0];
}

getEditors() {
return this.application.editorGroup.editors;
return this.application.editorGroup.noteControllers;
}

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

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

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

editorForNote(note: SNNote) {
Expand Down
130 changes: 0 additions & 130 deletions src/lib/editor.ts

This file was deleted.

Loading

0 comments on commit ac472c5

Please sign in to comment.