Skip to content

Commit

Permalink
fix: Device filtering not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
chedabob committed Mar 21, 2021
1 parent 8cf0a75 commit 502ceb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module FirebaseStats
VERSION = '1.0.4'
VERSION = '1.0.5'
end
4 changes: 2 additions & 2 deletions lib/wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def os(platform: :all, grouped: true, major_order: true)
# @param [Integer] limit Number of devices to turn
# @param [Symbol] platform One of :all, :ios, :android
def devices(friendly: false, limit: 10, platform: :all)
filtered = DeviceUtils.filter_device(@stats.data[:devices], @platform)
filtered = DeviceUtils.filter_device(@stats.data[:devices], platform)
filtered = filtered.take(limit || 10)
cleaned = []
filtered.each do |row|
device = {
'model' => row['Device model']
}
if friendly && ((@platform == :all) || (@platform == :android))
if friendly && ((platform == :all) || (platform == :android))
mapped = Android::Devices.search_by_model(row['Device model'])
device['friendly'] = if mapped.nil?
row['Device model']
Expand Down

0 comments on commit 502ceb3

Please sign in to comment.