Commit 47f04293 by 杨铁龙

disabledDbIndex

parent b779691b
Showing with 8 additions and 4 deletions
...@@ -82,6 +82,8 @@ export interface ChatOption { ...@@ -82,6 +82,8 @@ export interface ChatOption {
message?: ChatMessageController; message?: ChatMessageController;
avatar?: string; avatar?: string;
disabledDbIndex?:boolean;
} }
export interface ChatMessageController { export interface ChatMessageController {
......
...@@ -58,10 +58,12 @@ class Chat { ...@@ -58,10 +58,12 @@ class Chat {
option.message && (this.messageController = option.message); option.message && (this.messageController = option.message);
option.avatar !== undefined && (this.defaultAvatar = option.avatar); option.avatar !== undefined && (this.defaultAvatar = option.avatar);
await this.setupIndexDb(option.orgId()).catch(err => { if(!option.disabledDbIndex){
// 必须catch error不然小程序不会向后运行 await this.setupIndexDb(option.orgId()).catch(err => {
console.error("setupIndexDb Error") // 必须catch error不然小程序不会向后运行
}); console.error("setupIndexDb Error")
});
}
this.token = async () => option.sdk().global.jwtToken; this.token = async () => option.sdk().global.jwtToken;
tokenManager.save(this.token); tokenManager.save(this.token);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment