Replace draglist due to upstream errors (#1795)

* Replace draggable flatlist with simple sort buttons

* Remove react-native-draggable-flatlist dep

* Fix hitslops

* Update lockfile

* Remove bad flex:1
This commit is contained in:
Paul Frazee 2023-11-02 12:09:57 -07:00 committed by GitHub
parent 0e8723c3bb
commit 0f4bfcb05d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 133 additions and 172 deletions

View file

@ -95,19 +95,15 @@ export class SavedFeedsModel {
return
}
if (direction === 'up' && index !== 0) {
const temp = pinned[index]
pinned[index] = pinned[index - 1]
pinned[index - 1] = temp
;[pinned[index], pinned[index - 1]] = [pinned[index - 1], pinned[index]]
} else if (direction === 'down' && index < pinned.length - 1) {
const temp = pinned[index]
pinned[index] = pinned[index + 1]
pinned[index + 1] = temp
;[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,
)
this._updatePinSortOrder()
track('CustomFeed:Reorder', {
name: item.displayName,
uri: item.uri,