diff --git a/src/web/components/profile.ts b/src/web/components/profile.ts index 4bc52b0..42984d4 100644 --- a/src/web/components/profile.ts +++ b/src/web/components/profile.ts @@ -9,14 +9,8 @@ export interface ServiceLink { collection: string } -// Migration state for api.syui.ai users -export interface MigrationInfo { - hasOldApi: boolean - hasMigrated: boolean -} - // Get available services based on user's collections -export function getServiceLinks(handle: string, collections: string[], migration?: MigrationInfo): ServiceLink[] { +export function getServiceLinks(handle: string, collections: string[]): ServiceLink[] { const services: ServiceLink[] = [] if (collections.includes('ai.syui.card.user')) { @@ -28,8 +22,8 @@ export function getServiceLinks(handle: string, collections: string[], migration }) } - // Add migration link if user has api.syui.ai account - if (migration?.hasOldApi) { + // Card (old) - show if user has ai.syui.card.old collection + if (collections.includes('ai.syui.card.old')) { services.push({ name: 'Card (old)', icon: '/service/ai.syui.card.old.png', @@ -57,8 +51,7 @@ export async function renderProfile( handle: string, webUrl?: string, localOnly = false, - collections: string[] = [], - migration?: MigrationInfo + collections: string[] = [] ): Promise { // Local mode: sync, no API call. Remote mode: async with API call const avatarUrl = localOnly @@ -78,10 +71,10 @@ export async function renderProfile( ? `${escapeHtml(displayName)}` : `
` - // Service icons (show for users with matching collections or migration available) + // Service icons (show for users with matching collections) let serviceIconsHtml = '' - if (collections.length > 0 || migration?.hasOldApi) { - const services = getServiceLinks(handle, collections, migration) + if (collections.length > 0) { + const services = getServiceLinks(handle, collections) if (services.length > 0) { const iconsHtml = services.map(s => ` diff --git a/src/web/main.ts b/src/web/main.ts index 5c22e66..2ac2146 100644 --- a/src/web/main.ts +++ b/src/web/main.ts @@ -1,7 +1,7 @@ import './styles/main.css' import './styles/card.css' import './styles/card-migrate.css' -import { getConfig, resolveHandle, getProfile, getPosts, getPost, describeRepo, listRecords, getRecord, getPds, getNetworks, getChatMessages, getCards, getRse, getOldApiUserByDid, hasCardOldRecord } from './lib/api' +import { getConfig, resolveHandle, getProfile, getPosts, getPost, describeRepo, listRecords, getRecord, getPds, getNetworks, getChatMessages, getCards, getRse } from './lib/api' import { parseRoute, onRouteChange, navigate, type Route } from './lib/router' import { login, logout, handleCallback, restoreSession, isLoggedIn, getLoggedInHandle, getLoggedInDid, deleteRecord, updatePost } from './lib/auth' import { validateRecord } from './lib/lexicon' @@ -176,16 +176,9 @@ async function render(route: Route): Promise { const loggedInDid = getLoggedInDid() const isOwner = isLoggedIn() && loggedInDid === did - // Check migration status (api.syui.ai -> ATProto) - const [oldApiUser, hasMigrated] = await Promise.all([ - getOldApiUserByDid(did), - hasCardOldRecord(did) - ]) - const migration = oldApiUser ? { hasOldApi: true, hasMigrated } : undefined - // Profile section if (profile) { - html += await renderProfile(did, profile, handle, webUrl, localOnly, collections, migration) + html += await renderProfile(did, profile, handle, webUrl, localOnly, collections) } // Content section based on route type