fix substore display name

This commit is contained in:
pompurin404 2024-09-04 17:15:10 +08:00
parent a1d3558581
commit 7a1518c156
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View File

@ -79,7 +79,7 @@ const Profiles: React.FC = () => {
subs.forEach((sub, index) => { subs.forEach((sub, index) => {
items.push({ items.push({
key: `sub-${sub.name}`, key: `sub-${sub.name}`,
name: sub.displayName, name: sub.displayName || sub.name,
icon: sub.icon ? <img src={sub.icon} className="h-[18px] w-[18px]" /> : null, icon: sub.icon ? <img src={sub.icon} className="h-[18px] w-[18px]" /> : null,
divider: index === subs.length - 1 && Boolean(collections) && collections.length > 0 divider: index === subs.length - 1 && Boolean(collections) && collections.length > 0
}) })
@ -89,7 +89,7 @@ const Profiles: React.FC = () => {
collections.forEach((sub) => { collections.forEach((sub) => {
items.push({ items.push({
key: `collection-${sub.name}`, key: `collection-${sub.name}`,
name: sub.displayName, name: sub.displayName || sub.name,
icon: sub.icon ? <img src={sub.icon} className="h-[18px] w-[18px]" /> : null, icon: sub.icon ? <img src={sub.icon} className="h-[18px] w-[18px]" /> : null,
divider: false divider: false
}) })
@ -278,7 +278,7 @@ const Profiles: React.FC = () => {
(sub) => sub.name === key.toString().replace('sub-', '') (sub) => sub.name === key.toString().replace('sub-', '')
) )
await addProfileItem({ await addProfileItem({
name: sub?.displayName ?? '', name: sub?.displayName || sub?.name || '',
type: 'remote', type: 'remote',
url: useCustomSubStore url: useCustomSubStore
? `${customSubStoreUrl}/download/${key.toString().replace('sub-', '')}?target=ClashMeta` ? `${customSubStoreUrl}/download/${key.toString().replace('sub-', '')}?target=ClashMeta`
@ -299,7 +299,7 @@ const Profiles: React.FC = () => {
collection.name === key.toString().replace('collection-', '') collection.name === key.toString().replace('collection-', '')
) )
await addProfileItem({ await addProfileItem({
name: collection?.displayName ?? '', name: collection?.displayName || collection?.name || '',
type: 'remote', type: 'remote',
url: useCustomSubStore url: useCustomSubStore
? `${customSubStoreUrl}/download/collection/${key.toString().replace('collection-', '')}?target=ClashMeta` ? `${customSubStoreUrl}/download/collection/${key.toString().replace('collection-', '')}?target=ClashMeta`

View File

@ -404,7 +404,7 @@ interface IProfileItem {
interface ISubStoreSub { interface ISubStoreSub {
name: string name: string
displayName: sstring displayName?: string
icon?: string icon?: string
tag?: string[] tag?: string[]
} }