mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(dashboard): fix rendering error when multiple storage policy have same name (#319)
This commit is contained in:
parent
8c73fb8551
commit
9b88ecd4d8
|
|
@ -465,13 +465,13 @@ const StoragePolicySetting = () => {
|
|||
<Typography variant="h6">{t("policy.newStoragePolicy")}</Typography>
|
||||
</BorderedCardClickable>
|
||||
</Grid>
|
||||
{!loading && policies.map((p) => <StoragePolicyCard key={p.name} policy={p} onRefresh={fetchPolicies} />)}
|
||||
{!loading && policies.map((p) => <StoragePolicyCard key={p.id} policy={p} onRefresh={fetchPolicies} />)}
|
||||
{loading &&
|
||||
policies.length > 0 &&
|
||||
policies.map((p) => <StoragePolicyCard key={`loading-${p.name}`} loading={true} />)}
|
||||
policies.map((p) => <StoragePolicyCard key={`loading-${p.id}`} loading={true} />)}
|
||||
{loading &&
|
||||
policies.length === 0 &&
|
||||
Array.from(Array(5)).map((_, index) => <StoragePolicyCard key={`loading-${index}`} loading={true} />)}
|
||||
Array.from(Array(5)).map((_, index) => <StoragePolicyCard key={`loading-placeholder-${index}`} loading={true} />)}
|
||||
</Grid>
|
||||
{count > 0 && (
|
||||
<Box sx={{ mt: 1 }}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue