NativeScript / NativeScript/plugins

composing email with attachments fails on Android (fix provided)

未关闭
#199 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
206
派生
123
平均合并
2 天 1 小时
30 天内合并 PR
1

描述

@nativescript/Email v2.0.5

Error
Calling email.compose with array 'attachments' fails with this error:
JS: 'Error in email.compose: TypeError: Cannot read property 'indexOf' of undefined'

Problem
The problem is that 'compose' in "index.android.js" parses attachments using a "for-in" loop. My array created via brackets in JS has a 'move' method by default, and so this for-in loop parses 'attachments[move]' which fails.

Fix
The fix is simply to change it to a "for-of" loop, as is the case in "index.ios.js".
Replace this...
for (const a in arg.attachments) {
const attachment = arg.attachments[a];
with this...
for (const attachment of arg.attachments) {

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

打开 index.android.js,并将其附件处理方式与 index.ios.js 中的 for-of 循环进行比较。验证请求的迭代更改,并在 Android 上测试使用附件数组撰写电子邮件;完成的标准是附件不再触发报告的 indexOf 错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, javascript
领域
mobile
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
停滞
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。