修复比例默认选择和二维码预警崩溃
This commit is contained in:
@@ -89,8 +89,9 @@ function normalizeDraftForm(value: unknown): PublishForm {
|
||||
next.common_regions = Array.isArray(value.common_regions)
|
||||
? value.common_regions.filter((region): region is string => typeof region === 'string')
|
||||
: []
|
||||
// 默认使用参考比例:如果草稿中的 accelerated_sale_ratio 是 0 或未设置,重置为空字符串
|
||||
if (!next.accelerated_sale_ratio || next.accelerated_sale_ratio === 0) {
|
||||
// 默认使用参考比例:如果草稿中的 accelerated_sale_ratio 是 0、未设置或非法值,重置为空字符串
|
||||
const acceleratedRatio = Number(next.accelerated_sale_ratio)
|
||||
if (!Number.isFinite(acceleratedRatio) || acceleratedRatio <= 0) {
|
||||
next.accelerated_sale_ratio = ''
|
||||
}
|
||||
if (next.haf_coin_amount === 0) next.haf_coin_amount = ''
|
||||
|
||||
Reference in New Issue
Block a user