refactor: new snjs support (#967)

This commit is contained in:
Mo
2022-04-11 12:48:19 -05:00
committed by GitHub
parent 3126d97dca
commit 3a2ff2f440
44 changed files with 569 additions and 799 deletions

View File

@@ -104,7 +104,7 @@ const ListedActionsMenu: FunctionComponent<ListedActionsMenuProps> = ({
const updatedGroup: ListedMenuGroup = {
name: updatedAccountInfo.display_name,
account: group.account,
actions: updatedAccountInfo.actions,
actions: updatedAccountInfo.actions as Action[],
};
const updatedGroups = menuGroups.map((group) => {
@@ -145,7 +145,7 @@ const ListedActionsMenu: FunctionComponent<ListedActionsMenuProps> = ({
menuGroups.push({
name: accountInfo.display_name,
account,
actions: accountInfo.actions,
actions: accountInfo.actions as Action[],
});
} else {
menuGroups.push({

View File

@@ -219,7 +219,6 @@ export const NotesOptions = observer(
const notTrashed = notes.some((note) => !note.trashed);
const pinned = notes.some((note) => note.pinned);
const unpinned = notes.some((note) => !note.pinned);
const errored = notes.some((note) => note.errorDecrypting);
useEffect(() => {
const removeAltKeyObserver = application.io.addKeyObserver({
@@ -278,26 +277,6 @@ export const NotesOptions = observer(
});
};
if (errored) {
return (
<>
{notes.length === 1 ? (
<div className="px-3 pt-1.5 pb-1 text-xs color-neutral font-medium">
<div>
<span className="font-semibold">Note ID:</span> {notes[0].uuid}
</div>
</div>
) : null}
<DeletePermanentlyButton
closeOnBlur={closeOnBlur}
onClick={async () => {
await appState.notes.deleteNotesPermanently();
}}
/>
</>
);
}
const openRevisionHistoryModal = () => {
appState.notes.setShowRevisionHistoryModal(true);
};

View File

@@ -86,7 +86,7 @@ export const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
) => {
if (component) {
if (component.conflictOf) {
application.mutator.changeAndSaveItem(component.uuid, (mutator) => {
application.mutator.changeAndSaveItem(component, (mutator) => {
mutator.conflictOf = undefined;
});
}

View File

@@ -1,11 +1,13 @@
import { WebApplication } from '@/ui_models/application';
import {
ContentType,
FeatureStatus,
SNComponent,
ComponentArea,
FeatureDescription,
GetFeatures,
NoteType,
} from '@standardnotes/features';
import { ContentType, FeatureStatus, SNComponent } from '@standardnotes/snjs';
} from '@standardnotes/snjs';
import { EditorMenuItem, EditorMenuGroup } from '../ChangeEditorOption';
export const PLAIN_EDITOR_NAME = 'Plain Editor';