Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

Commit 38337fb

Browse files
committed
Fix #65 for Stall on Loading Icon
1 parent c563a35 commit 38337fb

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## N1-Unsubscribe (Nylas Mail Plugin - *Beta* version)
1+
## N1-Unsubscribe
22

33
![Unsubscribe: unsubscribe without leaving Nylas Mail](plugin.png)
44

5+
### A Nylas Mail Plugin *(To run on Nylas N1/Pro - [see this branch](https://github.com/colinking/n1-unsubscribe/tree/legacy-N1-support))*
6+
57
Quickly unsubscribe from emails without leaving N1. The unsubscribe plugin parses the `list-unsubscribe` header and the email body to look for the best way to unsubscribe. If an unsubscribe email address can be found, the plugin will send one in the background on your behalf. If only a browser link is found, either a mini N1 browser window will open or for certain cases, you will be redirected to your default browser.
68

79
## How to install

lib/thread-unsubscribe-store.es6

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ export default class ThreadUnsubscribeStore extends NylasStore {
103103
path: messagePath,
104104
headers: {Accept: "message/rfc822"},
105105
json: false,
106-
success: (rawEmail) => {
107-
const mailparser = new MailParser();
108-
mailparser.on('end', (parsedEmail) => {
109-
callback(null, parsedEmail);
110-
});
111-
mailparser.write(rawEmail);
112-
mailparser.end();
113-
},
114-
error: (error) => {
115-
callback(error);
116-
},
117-
}
106+
},
107+
});
108+
loadEmail.run()
109+
.then((rawEmail) => {
110+
const mailparser = new MailParser();
111+
mailparser.on('end', (parsedEmail) => {
112+
callback(null, parsedEmail);
113+
});
114+
mailparser.write(rawEmail);
115+
mailparser.end();
118116
})
119-
loadEmail.run();
117+
.catch((err) => {
118+
callback(err);
119+
});
120120
}
121121
} else {
122122
callback(new Error('No messages found to parse for unsubscribe links.'));

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "n1-unsubscribe",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"main": "./lib/main",
5-
"description": "Unsubscribe without leaving N1.",
5+
"description": "Unsubscribe without leaving Nylas Mail.",
66
"license": "GPL-3.0",
77
"title": "Unsubscribe",
88
"icon": "./icon.png",

plugin.png

1.03 KB
Loading

0 commit comments

Comments
 (0)