slight performance improvements
This commit is contained in:
@@ -292,11 +292,15 @@ export class PreferencesModel {
|
||||
return res
|
||||
}
|
||||
|
||||
setFeeds(saved: string[], pinned: string[]) {
|
||||
this.savedFeeds = saved
|
||||
this.pinnedFeeds = pinned
|
||||
}
|
||||
|
||||
async setSavedFeeds(saved: string[], pinned: string[]) {
|
||||
const oldSaved = this.savedFeeds
|
||||
const oldPinned = this.pinnedFeeds
|
||||
this.savedFeeds = saved
|
||||
this.pinnedFeeds = pinned
|
||||
this.setFeeds(saved, pinned)
|
||||
try {
|
||||
await this.update((prefs: AppBskyActorDefs.Preferences) => {
|
||||
const existing = prefs.find(
|
||||
|
||||
@@ -47,6 +47,10 @@ export class SavedFeedsModel {
|
||||
return this.feeds.filter(f => !this.isPinned(f))
|
||||
}
|
||||
|
||||
get all() {
|
||||
return this.pinned.concat(this.unpinned)
|
||||
}
|
||||
|
||||
get pinnedFeedNames() {
|
||||
return this.pinned.map(f => f.displayName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user