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

Commit c8efff1

Browse files
committed
Query packages by relevance, sort by downloads locally
1 parent e64b9e3 commit c8efff1

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

lib/atom-io-client.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ class AtomIoClient
196196
else if options.packages
197197
qs.filter = 'package'
198198

199-
if options.sort
200-
qs.sort = options.sort
201-
202199
options = {
203200
url: "#{@baseURL}packages/search"
204201
headers: {'User-Agent': navigator.userAgent}
@@ -217,4 +214,5 @@ class AtomIoClient
217214
body.filter (pkg) -> pkg.releases?.latest?
218215
.map ({readme, metadata, downloads, stargazers_count}) ->
219216
Object.assign metadata, {readme, downloads, stargazers_count}
217+
.sort (a, b) -> b.downloads - a.downloads
220218
)

lib/install-panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default class InstallPanel {
206206
this.refs.searchMessage.textContent = `Searching ${this.searchType} for \u201C${query}\u201D\u2026`
207207
this.refs.searchMessage.style.display = ''
208208

209-
const options = {sort: {downloads: 'desc'}}
209+
const options = {}
210210
options[this.searchType] = true
211211

212212
try {

0 commit comments

Comments
 (0)