refactor(basic): 优化主窗口获取逻辑
- 将判断错误码的条件从 if (errCode) 修改为 if (errCode !== 0) - 这样可以更准确地处理错误情况,避免潜在的逻辑错误
这个提交包含在:
父节点
0b8f57a13f
当前提交
20c20e5d5a
@ -21,7 +21,7 @@ export class GlobalContext {
|
||||
|
||||
context.windowStage.getMainWindow((err: BusinessError, data) => {
|
||||
let errCode: number = err.code;
|
||||
if (errCode) {
|
||||
if (errCode !== 0) {
|
||||
console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户