chore: fix ContentType usage (#2353)

* chore: fix ContentType usage

* chore: fix specs
This commit is contained in:
Karol Sójko
2023-07-12 13:53:29 +02:00
committed by GitHub
parent d057cdff84
commit 325737bfbd
247 changed files with 1092 additions and 1060 deletions

View File

@@ -415,7 +415,7 @@ export class AppContext {
if (!didCompleteRelevantSync) {
if (data?.savedPayloads) {
const matching = data.savedPayloads.find((p) => {
return p.content_type === ContentType.UserPrefs
return p.content_type === ContentType.TYPES.UserPrefs
})
if (matching) {
didCompleteRelevantSync = true
@@ -510,7 +510,7 @@ export class AppContext {
}
spyOnChangedItems(callback) {
this.application.items.addObserver(ContentType.Any, ({ changed, unerrored }) => {
this.application.items.addObserver(ContentType.TYPES.Any, ({ changed, unerrored }) => {
callback([...changed, ...unerrored])
})
}

View File

@@ -20,7 +20,7 @@ export function createItemParams(contentType) {
export function createNoteParams({ title, text, dirty = true } = {}) {
const params = {
uuid: Utils.generateUuid(),
content_type: ContentType.Note,
content_type: ContentType.TYPES.Note,
dirty: dirty,
dirtyIndex: dirty ? getIncrementedDirtyIndex() : undefined,
content: FillItemContent({
@@ -34,7 +34,7 @@ export function createNoteParams({ title, text, dirty = true } = {}) {
export function createTagParams({ title, dirty = true, uuid = undefined } = {}) {
const params = {
uuid: uuid || Utils.generateUuid(),
content_type: ContentType.Tag,
content_type: ContentType.TYPES.Tag,
dirty: dirty,
dirtyIndex: dirty ? getIncrementedDirtyIndex() : undefined,
content: FillItemContent({