xi-conversations

Minimal clone of thunderbird conversations
git clone https://git.ce9e.org/xi-conversations.git

commit
7911169dbe84e56b9de23168e2335bc717f64c61
parent
baf9eba88adbc403e76363ab1784acdc60c6fb4e
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-12-23 15:26
getConversation: reject promise on empty result

Diffstat

M experiment-api/api.js 10 +++++++---

1 files changed, 7 insertions, 3 deletions


diff --git a/experiment-api/api.js b/experiment-api/api.js

@@ -17,7 +17,7 @@ var unique = function(l, keyFn) {
   17    17 };
   18    18 
   19    19 var getConversation = function(ids) {
   20    -1 	return new Promise(resolve => {
   -1    20 	return new Promise((resolve, reject) => {
   21    21 		var conversationListener = {
   22    22 			onItemsAdded: function() {},
   23    23 			onItemsModified: function() {},
@@ -35,8 +35,12 @@ var getConversation = function(ids) {
   35    35 			onItemsModified: function() {},
   36    36 			onItemsRemoved: function() {},
   37    37 			onQueryCompleted: function(collection) {
   38    -1 				var conversation = collection.items[0].conversation;
   39    -1 				conversation.getMessagesCollection(conversationListener, true);
   -1    38 				if (collection.items.length > 0) {
   -1    39 					var conversation = collection.items[0].conversation;
   -1    40 					conversation.getMessagesCollection(conversationListener, true);
   -1    41 				} else {
   -1    42 					reject();
   -1    43 				}
   40    44 			},
   41    45 		};
   42    46