Skip to content

Commit e8383bc

Browse files
committed
fix(CardUpload): 增加去重逻辑
1 parent 6a17658 commit e8383bc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/BootstrapBlazor/Components/Upload/UploadBase.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -283,7 +283,13 @@ protected List<UploadFile> GetUploadFiles()
283283
{
284284
_filesCache.AddRange(DefaultFileList);
285285
}
286-
_filesCache.AddRange(UploadFiles);
286+
UploadFiles.ForEach(f =>
287+
{
288+
if (!_filesCache.Contains(f))
289+
{
290+
_filesCache.Add(f);
291+
}
292+
});
287293
}
288294
return _filesCache;
289295
}

0 commit comments

Comments
 (0)