diff --git a/features/home/src/main/ets/view/CommentKeyboard.ets b/features/home/src/main/ets/view/CommentKeyboard.ets index 16c380813b5aeda4f88a70c57d3cd18715dc0dfe..e8a39781a8be4f88386a745322cff231321ccb23 100644 --- a/features/home/src/main/ets/view/CommentKeyboard.ets +++ b/features/home/src/main/ets/view/CommentKeyboard.ets @@ -55,19 +55,19 @@ export struct CommentKeyboard { @Consume navDialogPageInfos: NavPathStack; aboutToAppear(): void { - window.getLastWindow(getContext(this)).then(win => { + window.getLastWindow(this.getUIContext().getHostContext()).then(win => { this.addKeyboardHeightListener(win); }); } aboutToDisappear(): void { - window.getLastWindow(getContext(this)).then(win => { + window.getLastWindow(this.getUIContext().getHostContext()).then(win => { this.removeKeyboardHeightListener(win); }); } getResourceString(resource: Resource): string { - return getContext(this).resourceManager.getStringSync(resource.id); + return this.getUIContext().getHostContext()!.resourceManager.getStringSync(resource.id); } addKeyboardHeightListener(win: window.Window) { @@ -354,7 +354,7 @@ export struct CommentKeyboard { .height( this.isEmojiKeyboardVisible ? this.keyboardHeight + this.frequentEmojiListHeight : - this.keyboardHeight + this.keyboardHeight ) } .backgroundColor(Color.White)