Commit 29137adbd49f561046ac03de0805a7398a10d949
1 parent
83aa57ab5b
Exists in
master
pull pending count update
Showing 1 changed file with 5 additions and 6 deletions Side-by-side Diff
gateway/pull.js
... | ... | @@ -21,7 +21,7 @@ if (!matrix.sdk_pending_tasks) { |
21 | 21 | matrix.sdk_pending_tasks_count = 0; |
22 | 22 | } |
23 | 23 | |
24 | -if (!matrix.sdk_active_tasks) { | |
24 | +if (!matrix.sdk_unresponsed_tasks) { | |
25 | 25 | matrix.sdk_unresponsed_tasks = []; |
26 | 26 | matrix.sdk_unresponsed_tasks_count = 0; |
27 | 27 | } |
... | ... | @@ -117,27 +117,26 @@ function updateTaskOnMatrix(trx_id, rc) { |
117 | 117 | if (unresponsed_task_idx >= 0) { |
118 | 118 | matrix.sdk_unresponsed_tasks.splice(unresponsed_task_idx, 1); |
119 | 119 | } |
120 | + matrix.sdk_unresponsed_tasks_count = matrix.sdk_unresponsed_tasks.length; | |
120 | 121 | |
121 | 122 | if (rc == '68') { |
122 | - const pending_task_idx = matrix.sdk_pending_tasks.indexOf(trx_id); | |
123 | - if (pending_task_idx < 0) { | |
124 | - matrix.sdk_pending_tasks.push(trx_id); | |
125 | - } | |
126 | - | |
127 | 123 | const pending_with_response_tasks_idx = matrix.sdk_pending_with_response_tasks.indexOf(trx_id); |
128 | 124 | if (pending_with_response_tasks_idx < 0) { |
129 | 125 | matrix.sdk_pending_with_response_tasks.push(trx_id); |
126 | + matrix.sdk_pending_with_response_tasks_count = matrix.sdk_pending_with_response_tasks.length; | |
130 | 127 | } |
131 | 128 | } |
132 | 129 | else { |
133 | 130 | const pending_task_idx = matrix.sdk_pending_tasks.indexOf(trx_id); |
134 | 131 | if (pending_task_idx >= 0) { |
135 | 132 | matrix.sdk_pending_tasks.splice(pending_task_idx, 1); |
133 | + matrix.sdk_pending_tasks_count = matrix.sdk_pending_tasks.length; | |
136 | 134 | } |
137 | 135 | |
138 | 136 | const pending_with_response_tasks_idx = matrix.sdk_pending_with_response_tasks.indexOf(trx_id); |
139 | 137 | if (pending_with_response_tasks_idx >= 0) { |
140 | 138 | matrix.sdk_pending_with_response_tasks.splice(pending_with_response_tasks_idx, 1); |
139 | + matrix.sdk_pending_with_response_tasks_count = matrix.sdk_pending_with_response_tasks.length; | |
141 | 140 | } |
142 | 141 | } |
143 | 142 | } |