feat: authorize notes for listed (#1823)

This commit is contained in:
Mo
2022-10-18 10:49:30 -05:00
committed by GitHub
parent e4de9c1be7
commit 9954bdc29f
14 changed files with 104 additions and 46 deletions

View File

@@ -16,6 +16,7 @@ export class SNNote extends DecryptedItem<NoteContent> implements NoteContentSpe
public readonly preview_html: string
public readonly spellcheck?: boolean
public readonly noteType?: NoteType
public readonly authorizedForListed: boolean
/** The package_info.identifier of the editor (not its uuid), such as org.standardnotes.advanced-markdown */
public readonly editorIdentifier?: FeatureIdentifier | string
@@ -31,6 +32,7 @@ export class SNNote extends DecryptedItem<NoteContent> implements NoteContentSpe
this.spellcheck = this.payload.content.spellcheck
this.noteType = this.payload.content.noteType
this.editorIdentifier = this.payload.content.editorIdentifier
this.authorizedForListed = this.payload.content.authorizedForListed || false
if (!this.noteType) {
const prefersPlain = this.getAppDomainValueWithDefault(AppDataField.LegacyPrefersPlainEditor, false)

View File

@@ -10,6 +10,7 @@ export interface NoteContentSpecialized {
spellcheck?: boolean
noteType?: NoteType
editorIdentifier?: FeatureIdentifier | string
authorizedForListed?: boolean
}
export type NoteContent = NoteContentSpecialized & ItemContent

View File

@@ -39,6 +39,10 @@ export class NoteMutator extends DecryptedItemMutator<NoteContent> {
this.mutableContent.editorIdentifier = identifier
}
set authorizedForListed(authorizedForListed: boolean) {
this.mutableContent.authorizedForListed = authorizedForListed
}
toggleSpellcheck(): void {
if (this.mutableContent.spellcheck == undefined) {
this.mutableContent.spellcheck = false