File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,18 @@ class DetectDeviceService {
11
11
this . pixelDensity = PixelRatio . get ( ) ;
12
12
this . width = windowSize . width ;
13
13
this . height = windowSize . height ;
14
+ this . adjustedWidth = this . width * this . pixelDensity ;
15
+ this . adjustedHeight = this . height * this . pixelDensity ;
14
16
15
17
this . isPhoneOrTablet ( ) ;
16
18
this . isIosOrAndroid ( ) ;
17
19
}
18
20
19
21
isPhoneOrTablet ( ) {
20
- if ( this . pixelDensity < 2 && ( this . width >= 1000 || this . height >= 1000 ) ) {
22
+ if ( this . pixelDensity < 2 && ( this . adjustedWidth >= 1000 || this . adjustedHeight >= 1000 ) ) {
21
23
this . isTablet = true ;
22
24
this . isPhone = false ;
23
- } else if ( this . pixelDensity === 2 && ( this . width >= 1920 || this . height >= 1920 ) ) {
25
+ } else if ( this . pixelDensity === 2 && ( this . adjustedWidth >= 1920 || this . adjustedHeight >= 1920 ) ) {
24
26
this . isTablet = true ;
25
27
this . isPhone = false ;
26
28
} else {
@@ -40,4 +42,4 @@ class DetectDeviceService {
40
42
}
41
43
}
42
44
43
- module . exports = new DetectDeviceService ( ) ;
45
+ module . exports = new DetectDeviceService ( ) ;
You can’t perform that action at this time.
0 commit comments