Commit fee0ea0d by zhousil
parents 90f2bc96 fd83ad63
Showing with 5 additions and 2 deletions
...@@ -42,6 +42,7 @@ class ChatCacheDatabaseController { ...@@ -42,6 +42,7 @@ class ChatCacheDatabaseController {
// eslint-disable-next-line @typescript-eslint/no-this-alias // eslint-disable-next-line @typescript-eslint/no-this-alias
const that = this; const that = this;
const setupDb = () => { const setupDb = () => {
if (this.setuping) {
if (that.db) { if (that.db) {
try { try {
that.buildTables(that.db, that.chatListKey); that.buildTables(that.db, that.chatListKey);
...@@ -53,16 +54,17 @@ class ChatCacheDatabaseController { ...@@ -53,16 +54,17 @@ class ChatCacheDatabaseController {
} }
} }
this.setuping = false; this.setuping = false;
}
resolve(); resolve();
}; };
r.onsuccess = function(e) { r.onsuccess = function(e) {
that.db = (e.target as any).result; that.db = (e.target as any).result;
console.log(`index database init comepleted, 33%`); console.log(`index database init comepleted`);
setupDb(); setupDb();
}; };
r.onupgradeneeded = function(e) { r.onupgradeneeded = function(e) {
that.db = (e.target as any).result; that.db = (e.target as any).result;
console.log(`index database init comepleted, 66%`); console.log(`upgrade database comepleted`);
setupDb(); setupDb();
}; };
r.onerror = function(e) { r.onerror = function(e) {
......
...@@ -47,6 +47,7 @@ export interface Chat { ...@@ -47,6 +47,7 @@ export interface Chat {
chat_id: number; chat_id: number;
catalog: string; catalog: string;
biz_type_id: number; biz_type_id: number;
biz_type_code: string;
business_data?: string; business_data?: string;
detail_name?: string; detail_name?: string;
} }
......
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