未验证 提交 62da8846 编写于 作者: O openharmony_ci 提交者: Gitee

!15993 Fix err code of CommonEvent

Merge pull request !15993 from xuzhihao/master
......@@ -299,11 +299,12 @@ function subscribeCB(err, data) {
}
// 创建订阅者回调
function createCB(err, subscriber) {
function createCB(err, commonEventSubscriber) {
if (err.code) {
console.error(`createSubscriber failed, code is ${err.code}`);
} else {
console.info("createSubscriber");
subscriber = commonEventSubscriber;
// 订阅公共事件
CommonEvent.subscribe(subscriber, subscribeCB);
}
......
......@@ -335,9 +335,10 @@ function SubscribeCB(err, data) {
}
//创建订阅者回调
function createCB(err, subscriber) {
function createCB(err, commonEventSubscriber) {
if(!err) {
console.info("createSubscriber");
subscriber = commonEventSubscriber;
//订阅公共事件
try {
CommonEventManager.subscribe(subscriber, SubscribeCB);
......@@ -391,11 +392,12 @@ function subscribeCB(err, data) {
}
}
//创建订阅者回调
function createCB(err, subscriber) {
function createCB(err, commonEventSubscriber) {
if (err) {
console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} else {
console.info("createSubscriber");
subscriber = commonEventSubscriber;
//订阅公共事件
try {
CommonEventManager.subscribe(subscriber, subscribeCB);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册