slight performance improvements

This commit is contained in:
Ansh Nanda 2023-05-23 15:28:46 -07:00
parent b561a51ed9
commit fc9e28ca72
4 changed files with 33 additions and 4 deletions

View file

@ -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(