Merge branch 'develop' into release/3.6.8
This commit is contained in:
@@ -40,6 +40,8 @@ export const STRING_UNARCHIVE_LOCKED_ATTEMPT =
|
|||||||
"This note is locked. If you'd like to archive it, unlock it, and try again.";
|
"This note is locked. If you'd like to archive it, unlock it, and try again.";
|
||||||
export const STRING_DELETE_LOCKED_ATTEMPT =
|
export const STRING_DELETE_LOCKED_ATTEMPT =
|
||||||
"This note is locked. If you'd like to delete it, unlock it, and try again.";
|
"This note is locked. If you'd like to delete it, unlock it, and try again.";
|
||||||
|
export const STRING_EDIT_LOCKED_ATTEMPT =
|
||||||
|
"This note is locked. If you'd like to edit its options, unlock it, and try again.";
|
||||||
export function StringDeleteNote(title: string, permanently: boolean) {
|
export function StringDeleteNote(title: string, permanently: boolean) {
|
||||||
return permanently
|
return permanently
|
||||||
? `Are you sure you want to permanently delete ${title}?`
|
? `Are you sure you want to permanently delete ${title}?`
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import {
|
|||||||
STRING_ELLIPSES,
|
STRING_ELLIPSES,
|
||||||
STRING_DELETE_PLACEHOLDER_ATTEMPT,
|
STRING_DELETE_PLACEHOLDER_ATTEMPT,
|
||||||
STRING_DELETE_LOCKED_ATTEMPT,
|
STRING_DELETE_LOCKED_ATTEMPT,
|
||||||
|
STRING_EDIT_LOCKED_ATTEMPT,
|
||||||
StringDeleteNote,
|
StringDeleteNote,
|
||||||
StringEmptyTrash,
|
StringEmptyTrash,
|
||||||
} from '@/strings';
|
} from '@/strings';
|
||||||
@@ -202,9 +203,12 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
if (!this.editorValues.text) {
|
if (!this.editorValues.text) {
|
||||||
this.editorValues.text = note.text;
|
this.editorValues.text = note.text;
|
||||||
}
|
}
|
||||||
if (note.lastSyncBegan) {
|
if (note.lastSyncBegan || note.dirty) {
|
||||||
if (note.lastSyncEnd) {
|
if (note.lastSyncEnd) {
|
||||||
if (note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()) {
|
if (
|
||||||
|
note.dirty ||
|
||||||
|
note.lastSyncBegan!.getTime() > note.lastSyncEnd!.getTime()
|
||||||
|
) {
|
||||||
this.showSavingStatus();
|
this.showSavingStatus();
|
||||||
} else if (
|
} else if (
|
||||||
note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()
|
note.lastSyncEnd!.getTime() > note.lastSyncBegan!.getTime()
|
||||||
@@ -305,6 +309,9 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
this.reloadPreferences();
|
this.reloadPreferences();
|
||||||
this.reloadStackComponents();
|
this.reloadStackComponents();
|
||||||
this.reloadNoteTagsComponent();
|
this.reloadNoteTagsComponent();
|
||||||
|
if (note.dirty) {
|
||||||
|
this.showSavingStatus();
|
||||||
|
}
|
||||||
if (note.safeText().length === 0 && !showProtectedWarning) {
|
if (note.safeText().length === 0 && !showProtectedWarning) {
|
||||||
this.focusTitle();
|
this.focusTitle();
|
||||||
}
|
}
|
||||||
@@ -412,6 +419,10 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
if (this.appState.getActiveEditor()?.isTemplateNote) {
|
if (this.appState.getActiveEditor()?.isTemplateNote) {
|
||||||
await this.appState.getActiveEditor().insertTemplatedNote();
|
await this.appState.getActiveEditor().insertTemplatedNote();
|
||||||
}
|
}
|
||||||
|
if (this.note.locked) {
|
||||||
|
this.application.alertService.alert(STRING_EDIT_LOCKED_ATTEMPT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!component) {
|
if (!component) {
|
||||||
if (!this.note.prefersPlainEditor) {
|
if (!this.note.prefersPlainEditor) {
|
||||||
await this.application.changeItem(this.note.uuid, (mutator) => {
|
await this.application.changeItem(this.note.uuid, (mutator) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user