Skip to content

Commit 514ccda

Browse files
committed
MOBILE-3523 ios: Fix error calculating platform version
1 parent d986401 commit 514ccda

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/core/editor/components/rich-text-editor/rich-text-editor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, AfterContentInit, OnDestroy, Optional }
1616
from '@angular/core';
1717
import { TextInput, Content, Platform, Slides } from 'ionic-angular';
18+
import { Device } from '@ionic-native/device';
1819
import { CoreApp } from '@providers/app';
1920
import { CoreSitesProvider } from '@providers/sites';
2021
import { CoreFilepoolProvider } from '@providers/filepool';
@@ -118,7 +119,8 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe
118119
protected events: CoreEventsProvider,
119120
protected utils: CoreUtilsProvider,
120121
protected platform: Platform,
121-
protected editorOffline: CoreEditorOfflineProvider) {
122+
protected editorOffline: CoreEditorOfflineProvider,
123+
protected device: Device) {
122124
this.contentChanged = new EventEmitter<string>();
123125
this.element = elementRef.nativeElement as HTMLDivElement;
124126
this.pageInstance = 'app_' + Date.now(); // Generate a "unique" ID based on timestamp.
@@ -236,7 +238,7 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe
236238
if (CoreApp.instance.isAndroid()) {
237239
// In Android we ignore the keyboard height because it is not part of the web view.
238240
height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element);
239-
} else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && this.platform.version().major < 12) {
241+
} else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && Number(this.device.version.split('.')[0]) < 12) {
240242
// Keyboard open in iOS 11 or previous. The window height changes when the keyboard is open.
241243
height = window.innerHeight - this.getSurroundingHeight(this.element);
242244

src/core/fileuploader/providers/file-handler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export class CoreFileUploaderFileHandler implements CoreFileUploaderHandler {
4444
* @return True or promise resolved with true if enabled.
4545
*/
4646
isEnabled(): boolean | Promise<boolean> {
47-
return CoreApp.instance.isAndroid() || !CoreApp.instance.isMobile() ||
48-
(CoreApp.instance.isIOS() && this.platform.version().major >= 9);
47+
return true;
4948
}
5049

5150
/**

0 commit comments

Comments
 (0)