Commit c0d800bf authored by Sheetal Umesh Kumar's avatar Sheetal Umesh Kumar Committed by GitHub

Merge pull request #36 from hypothesis/fix-empty-annot-state

Update UI state after search API request completes with no results
parents e3f343b3 6801a49a
......@@ -224,8 +224,14 @@ module.exports = function WidgetController(
}
});
searchClient.on('end', function () {
// Remove client from list of active search clients
searchClients.splice(searchClients.indexOf(searchClient), 1);
// Remove client from list of active search clients.
//
// $evalAsync is required here because search results are emitted
// asynchronously. A better solution would be that the loading state is
// tracked as part of the app state.
$scope.$evalAsync(function () {
searchClients.splice(searchClients.indexOf(searchClient), 1);
});
});
searchClient.get({uri: uris, group: group});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment