Bluesky app fork with some witchin' additions 💫

Fix prefetching starter pack query (#9595)

* fix prefetching starter pack query

* add comment

authored by samuel.fm and committed by

GitHub d91e206e 493bd6dc

+14 -1
+14 -1
src/state/queries/starter-packs.ts
··· 1 import { 2 - type AppBskyFeedDefs, 3 AppBskyGraphDefs, 4 type AppBskyGraphGetStarterPack, 5 AppBskyGraphStarterpack, ··· 369 AppBskyGraphDefs.isStarterPackViewBasic(starterPack) && 370 bsky.validate(starterPack.record, AppBskyGraphStarterpack.validateRecord) 371 ) { 372 const listView: AppBskyGraphDefs.ListViewBasic = { 373 uri: starterPack.record.list, 374 // This will be populated once the data from server is fetched ··· 380 ...starterPack, 381 $type: 'app.bsky.graph.defs#starterPackView', 382 list: listView, 383 } 384 } 385
··· 1 import { 2 + AppBskyFeedDefs, 3 AppBskyGraphDefs, 4 type AppBskyGraphGetStarterPack, 5 AppBskyGraphStarterpack, ··· 369 AppBskyGraphDefs.isStarterPackViewBasic(starterPack) && 370 bsky.validate(starterPack.record, AppBskyGraphStarterpack.validateRecord) 371 ) { 372 + let feeds: AppBskyFeedDefs.GeneratorView[] | undefined 373 + if (starterPack.record.feeds) { 374 + feeds = [] 375 + for (const feed of starterPack.record.feeds) { 376 + // note: types are wrong? claims to be `FeedItem`, but we actually 377 + // get un$typed `GeneratorView` objects here -sfn 378 + if (bsky.validate(feed, AppBskyFeedDefs.validateGeneratorView)) { 379 + feeds.push(feed) 380 + } 381 + } 382 + } 383 + 384 const listView: AppBskyGraphDefs.ListViewBasic = { 385 uri: starterPack.record.list, 386 // This will be populated once the data from server is fetched ··· 392 ...starterPack, 393 $type: 'app.bsky.graph.defs#starterPackView', 394 list: listView, 395 + feeds, 396 } 397 } 398