Hook debugTopics to override X-Bsky-Topics (#6060)
(cherry picked from commit 8d5b551ed6)
This commit is contained in:
@@ -1,11 +1,18 @@
|
|||||||
import {AtUri} from '@atproto/api'
|
import {AtUri} from '@atproto/api'
|
||||||
|
|
||||||
import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants'
|
import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants'
|
||||||
|
import {isWeb} from '#/platform/detection'
|
||||||
import {UsePreferencesQueryResponse} from '#/state/queries/preferences'
|
import {UsePreferencesQueryResponse} from '#/state/queries/preferences'
|
||||||
|
|
||||||
|
let debugTopics = ''
|
||||||
|
if (isWeb && typeof window !== 'undefined') {
|
||||||
|
const params = new URLSearchParams(window.location.search)
|
||||||
|
debugTopics = params.get('debug_topics') ?? ''
|
||||||
|
}
|
||||||
|
|
||||||
export function createBskyTopicsHeader(userInterests?: string) {
|
export function createBskyTopicsHeader(userInterests?: string) {
|
||||||
return {
|
return {
|
||||||
'X-Bsky-Topics': userInterests || '',
|
'X-Bsky-Topics': debugTopics || userInterests || '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user