refactor: usePreference + update TS tooling (#2333)

This commit is contained in:
Aman Harwara
2023-05-11 20:04:14 +05:30
committed by GitHub
parent bcd962f150
commit 3b5bf1e509
188 changed files with 544 additions and 2028 deletions

View File

@@ -1,5 +1,6 @@
import { WebApplication } from '@/Application/WebApplication'
import { InvisibleSuperConverter } from '@/Components/SuperEditor/Tools/InvisibleMarkdownConverter'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import { NoteType, PrefKey, SNNote } from '@standardnotes/snjs'
export const getNoteFormat = (application: WebApplication, note: SNNote) => {
@@ -8,7 +9,10 @@ export const getNoteFormat = (application: WebApplication, note: SNNote) => {
const isSuperNote = note.noteType === NoteType.Super
if (isSuperNote) {
const superNoteExportFormatPref = application.getPreference(PrefKey.SuperNoteExportFormat) || 'json'
const superNoteExportFormatPref = application.getPreference(
PrefKey.SuperNoteExportFormat,
PrefDefaults[PrefKey.SuperNoteExportFormat],
)
return superNoteExportFormatPref
}