Skip to content

Commit

Permalink
fix(ios): writeKeyboardHeightIfDoesNotExist logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
sgschantz committed Dec 9, 2024
1 parent c9d4c5c commit b1d23b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
}

open class var topBarHeight: CGFloat {
os_log("topBarHeight", log:KeymanEngineLogger.ui, type: .info)
let scaling = KeyboardScaleMap.getDeviceDefaultKeyboardScale(forPortrait: self.isPortrait)

return scaling?.bannerHeight ?? 38 // default for iPhone SE, older/smaller devices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,15 +775,17 @@ extension KeymanWebViewController {
* overwrite that value with a default value derived for this device.
*/
func writeKeyboardHeightIfDoesNotExist(isPortrait: Bool, height: CGFloat) {
let writeMessage = "writeKeyboardHeight, isPortrait: \(isPortrait) height: \(height)"
let writeMessage = "writeKeyboardHeightIfDoesNotExist, isPortrait: \(isPortrait) height: \(height)"
os_log("%{public}s", log:KeymanEngineLogger.ui, type: .info, writeMessage)
if (isPortrait) {
if (Storage.active.userDefaults.object(forKey: Key.portraitKeyboardHeight) != nil) {
if (Storage.active.userDefaults.object(forKey: Key.portraitKeyboardHeight) == nil) {
Storage.active.userDefaults.portraitKeyboardHeight = height
os_log("portrait keyboardHeight default value written", log:KeymanEngineLogger.ui, type: .info, writeMessage)
}
} else {
if (Storage.active.userDefaults.object(forKey: Key.landscapeKeyboardHeight) != nil) {
if (Storage.active.userDefaults.object(forKey: Key.landscapeKeyboardHeight) == nil) {
Storage.active.userDefaults.landscapeKeyboardHeight = height
os_log("landscape keyboardHeight default value written", log:KeymanEngineLogger.ui, type: .info, writeMessage)
}
}
}
Expand Down

0 comments on commit b1d23b2

Please sign in to comment.