feat: starred notes (#1813)
This commit is contained in:
@@ -13,6 +13,7 @@ export interface ItemContent {
|
||||
trashed?: boolean
|
||||
pinned?: boolean
|
||||
archived?: boolean
|
||||
starred?: boolean
|
||||
locked?: boolean
|
||||
appData?: AppData
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export class DecryptedItem<C extends ItemContent = ItemContent>
|
||||
public readonly pinned: boolean = false
|
||||
public readonly archived: boolean = false
|
||||
public readonly locked: boolean = false
|
||||
public readonly starred: boolean = false
|
||||
|
||||
constructor(payload: DecryptedPayloadInterface<C>) {
|
||||
super(payload)
|
||||
@@ -32,6 +33,7 @@ export class DecryptedItem<C extends ItemContent = ItemContent>
|
||||
this.updatedAtString = dateToLocalizedString(this.userModifiedDate)
|
||||
this.protected = useBoolean(this.payload.content.protected, false)
|
||||
this.trashed = useBoolean(this.payload.content.trashed, false)
|
||||
this.starred = useBoolean(this.payload.content.starred, false)
|
||||
this.pinned = this.getAppDomainValueWithDefault(AppDataField.Pinned, false)
|
||||
this.archived = this.getAppDomainValueWithDefault(AppDataField.Archived, false)
|
||||
this.locked = this.getAppDomainValueWithDefault(AppDataField.Locked, false)
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface DecryptedItemInterface<C extends ItemContent = ItemContent>
|
||||
readonly pinned: boolean
|
||||
readonly archived: boolean
|
||||
readonly locked: boolean
|
||||
readonly starred: boolean
|
||||
readonly userModifiedDate: Date
|
||||
readonly references: ContentReference[]
|
||||
|
||||
|
||||
@@ -78,6 +78,10 @@ export class DecryptedItemMutator<C extends ItemContent = ItemContent> extends I
|
||||
this.mutableContent.trashed = trashed
|
||||
}
|
||||
|
||||
set starred(starred: boolean) {
|
||||
this.mutableContent.starred = starred
|
||||
}
|
||||
|
||||
public set pinned(pinned: boolean) {
|
||||
this.setAppDataItem(AppDataField.Pinned, pinned)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user