fix: ensure emailForwardingList is always initialized (#799)

- Fix emailRuleSettings initialization to ensure emailForwardingList is always an array
- Prevent SyntaxError when adding new forwarding rules with incomplete backend data
- Use optional chaining to safely access emailRuleSettings fields

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2025-12-31 02:04:42 +08:00
committed by GitHub
parent 3ebe22115a
commit aee1f1942b

View File

@@ -255,9 +255,9 @@ const fetchData = async () => {
verifiedAddressList.value = res.verifiedAddressList || []
fromBlockList.value = res.fromBlockList || []
noLimitSendAddressList.value = res.noLimitSendAddressList || []
emailRuleSettings.value = res.emailRuleSettings || {
blockReceiveUnknowAddressEmail: false,
emailForwardingList: []
emailRuleSettings.value = {
blockReceiveUnknowAddressEmail: res.emailRuleSettings?.blockReceiveUnknowAddressEmail || false,
emailForwardingList: res.emailRuleSettings?.emailForwardingList || []
}
} catch (error) {
message.error(error.message || "error");