mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 15:00:12 +00:00
update interfaces/kits/napi/window_runtime/window_napi/js_window.cpp.
Signed-off-by: yanghongnan <hongnanyang2014@yeah.net>
This commit is contained in:
parent
ee6ba6b489
commit
b3f69d51b1
@ -5820,15 +5820,10 @@ napi_value JsWindow::OnGetImmersiveModeEnabledState(napi_env env, napi_callback_
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "[NAPI]OnGetImmersiveModeEnabledState is not allowed since invalid window type");
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_CALLING);
|
||||
}
|
||||
wptr<Window> weakToken(windowToken_);
|
||||
auto window = weakToken.promote();
|
||||
if (window == nullptr) {
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "window is nullptr");
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY);
|
||||
}
|
||||
bool isEnabled = window->GetImmersiveModeEnabledState();
|
||||
|
||||
bool isEnabled = windowToken_->GetImmersiveModeEnabledState();
|
||||
TLOGI(WmsLogTag::WMS_IMMS, "window [%{public}u, %{public}s] get isImmersiveMode end, isEnabled = %{public}u",
|
||||
window->GetWindowId(), window->GetWindowName().c_str(), isEnabled);
|
||||
windowToken_->GetWindowId(), windowToken_->GetWindowName().c_str(), isEnabled);
|
||||
return CreateJsValue(env, isEnabled);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user