fix: add a workaround type check for tipUsers to ensure it's an array (#1531)

This commit is contained in:
Whitewater
2024-11-09 18:53:55 +08:00
committed by GitHub
parent eeadf96062
commit 5fed7c8629
+7 -1
View File
@@ -54,7 +54,13 @@ class FeedActions {
if (targetFeed?.owner) {
feed.owner = { ...targetFeed.owner }
}
if (targetFeed && "tipUsers" in targetFeed && targetFeed.tipUsers) {
if (
targetFeed &&
"tipUsers" in targetFeed &&
targetFeed.tipUsers &&
// Workaround for type issue
Array.isArray(targetFeed.tipUsers)
) {
feed.tipUsers = [...targetFeed.tipUsers]
}