diff options
author | Eric Bailey <git@esb.lol> | 2023-11-12 13:31:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-12 11:31:11 -0800 |
commit | 05b728fffcdb17708fdb52685725faf7fdc545bc (patch) | |
tree | b6523916d965f921d3f03d101dc60a7e74569bce /src/state/models/ui/saved-feeds.ts | |
parent | c8c308e31e63607280648e3e9f1f56a371adcd05 (diff) | |
download | voidsky-05b728fffcdb17708fdb52685725faf7fdc545bc.tar.zst |
Eric/preferences (#1873)
* Add initial preferences query, couple mutations * Remove unused * Clean up labels, migrate getModerationOpts * Add birth date handling * Migrate feed prefs * Migrate thread view prefs * Migrate homeFeed to use existing key name * Fix up saved feeds in response, no impl yet * Migrate saved feeds to new hooks * Clean up more of preferences * Fix PreferencesThreads load state * Fix modal dismissal * Small spacing fix --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/state/models/ui/saved-feeds.ts')
-rw-r--r-- | src/state/models/ui/saved-feeds.ts | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/state/models/ui/saved-feeds.ts b/src/state/models/ui/saved-feeds.ts index 624da4f5f..cf4cf6d71 100644 --- a/src/state/models/ui/saved-feeds.ts +++ b/src/state/models/ui/saved-feeds.ts @@ -3,7 +3,6 @@ import {RootStoreModel} from '../root-store' import {bundleAsync} from 'lib/async/bundle' import {cleanError} from 'lib/strings/errors' import {FeedSourceModel} from '../content/feed-source' -import {track} from 'lib/analytics/analytics' import {logger} from '#/logger' export class SavedFeedsModel { @@ -69,7 +68,6 @@ export class SavedFeedsModel { refresh = bundleAsync(async () => { this._xLoading(true) try { - await this.rootStore.preferences.sync() const uris = dedup( this.rootStore.preferences.pinnedFeeds.concat( this.rootStore.preferences.savedFeeds, @@ -87,37 +85,6 @@ export class SavedFeedsModel { } }) - async reorderPinnedFeeds(feeds: FeedSourceModel[]) { - this._updatePinSortOrder(feeds.map(f => f.uri)) - await this.rootStore.preferences.setSavedFeeds( - this.rootStore.preferences.savedFeeds, - feeds.filter(feed => feed.isPinned).map(feed => feed.uri), - ) - } - - async movePinnedFeed(item: FeedSourceModel, direction: 'up' | 'down') { - const pinned = this.rootStore.preferences.pinnedFeeds.slice() - const index = pinned.indexOf(item.uri) - if (index === -1) { - return - } - if (direction === 'up' && index !== 0) { - ;[pinned[index], pinned[index - 1]] = [pinned[index - 1], pinned[index]] - } else if (direction === 'down' && index < pinned.length - 1) { - ;[pinned[index], pinned[index + 1]] = [pinned[index + 1], pinned[index]] - } - this._updatePinSortOrder(pinned.concat(this.unpinned.map(f => f.uri))) - await this.rootStore.preferences.setSavedFeeds( - this.rootStore.preferences.savedFeeds, - pinned, - ) - track('CustomFeed:Reorder', { - name: item.displayName, - uri: item.uri, - index: pinned.indexOf(item.uri), - }) - } - // state transitions // = |