refactor: merge themes into components (#2388)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ApplicationStage } from '@standardnotes/services'
|
||||
import { Migration } from '@Lib/Migrations/Migration'
|
||||
import { ThemeInterface } from '@standardnotes/models'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
import { ComponentInterface } from '@standardnotes/models'
|
||||
|
||||
const NoDistractionIdentifier = 'org.standardnotes.theme-no-distraction'
|
||||
|
||||
@@ -18,7 +18,7 @@ export class Migration2_42_0 extends Migration {
|
||||
}
|
||||
|
||||
private async deleteNoDistraction(): Promise<void> {
|
||||
const themes = this.services.itemManager.getItems<ThemeInterface>(ContentType.TYPES.Theme).filter((theme) => {
|
||||
const themes = this.services.itemManager.getItems<ComponentInterface>(ContentType.TYPES.Theme).filter((theme) => {
|
||||
return theme.identifier === NoDistractionIdentifier
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CompoundPredicate, Predicate, SNComponent } from '@standardnotes/models'
|
||||
import { CompoundPredicate, Predicate, ComponentItem } from '@standardnotes/models'
|
||||
import { Migration } from '@Lib/Migrations/Migration'
|
||||
import { ApplicationStage } from '@standardnotes/services'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
@@ -19,8 +19,8 @@ export class Migration2_7_0 extends Migration {
|
||||
const batchMgrId = 'org.standardnotes.batch-manager'
|
||||
|
||||
const batchMgrPred = new CompoundPredicate('and', [
|
||||
new Predicate<SNComponent>('content_type', '=', ContentType.TYPES.Component),
|
||||
new Predicate<SNComponent>('identifier', '=', batchMgrId),
|
||||
new Predicate<ComponentItem>('content_type', '=', ContentType.TYPES.Component),
|
||||
new Predicate<ComponentItem>('identifier', '=', batchMgrId),
|
||||
])
|
||||
|
||||
const batchMgrSingleton = this.services.singletonManager.findSingleton(ContentType.TYPES.Component, batchMgrPred)
|
||||
|
||||
Reference in New Issue
Block a user