fix
This commit is contained in:
@@ -63,6 +63,17 @@ export const atproto = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getProfile(bsky, actor) {
|
async getProfile(bsky, actor) {
|
||||||
|
// Skip test DIDs
|
||||||
|
if (actor && actor.includes('test-')) {
|
||||||
|
logger.log('Skipping profile fetch for test DID:', actor)
|
||||||
|
return {
|
||||||
|
did: actor,
|
||||||
|
handle: 'test.user',
|
||||||
|
displayName: 'Test User',
|
||||||
|
avatar: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return await request(`${bsky}/xrpc/${ENDPOINTS.getProfile}?actor=${actor}`)
|
return await request(`${bsky}/xrpc/${ENDPOINTS.getProfile}?actor=${actor}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -80,7 +80,8 @@ export class OAuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get profile information using authenticated agent
|
// Get profile information using authenticated agent
|
||||||
if (this.agent) {
|
// Skip test DIDs
|
||||||
|
if (this.agent && did && !did.includes('test-')) {
|
||||||
try {
|
try {
|
||||||
await new Promise(resolve => setTimeout(resolve, 300))
|
await new Promise(resolve => setTimeout(resolve, 300))
|
||||||
const profile = await this.agent.getProfile({ actor: did })
|
const profile = await this.agent.getProfile({ actor: did })
|
||||||
@@ -98,6 +99,8 @@ export class OAuthService {
|
|||||||
console.log('Failed to get profile from session:', error)
|
console.log('Failed to get profile from session:', error)
|
||||||
// Keep the basic info we have
|
// Keep the basic info we have
|
||||||
}
|
}
|
||||||
|
} else if (did && did.includes('test-')) {
|
||||||
|
console.log('Skipping profile fetch for test DID:', did)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sessionInfo = {
|
this.sessionInfo = {
|
||||||
|
@@ -33,6 +33,12 @@ async function getDid(handle) {
|
|||||||
|
|
||||||
// DIDからプロフィール情報を取得
|
// DIDからプロフィール情報を取得
|
||||||
async function getProfile(did, handle) {
|
async function getProfile(did, handle) {
|
||||||
|
// Skip test DIDs
|
||||||
|
if (did && did.includes('test-')) {
|
||||||
|
logger.log('Skipping profile fetch for test DID:', did)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Determine which public API to use based on handle
|
// Determine which public API to use based on handle
|
||||||
const pds = await getPdsFromHandle(handle)
|
const pds = await getPdsFromHandle(handle)
|
||||||
@@ -81,6 +87,11 @@ async function fetchFreshAvatar(handle, did) {
|
|||||||
|
|
||||||
// プロフィール取得
|
// プロフィール取得
|
||||||
const profile = await getProfile(actualDid, handle)
|
const profile = await getProfile(actualDid, handle)
|
||||||
|
if (!profile) {
|
||||||
|
// Test DID or profile fetch failed
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
const avatarUrl = profile.avatar || null
|
const avatarUrl = profile.avatar || null
|
||||||
|
|
||||||
// キャッシュに保存
|
// キャッシュに保存
|
||||||
|
Reference in New Issue
Block a user