Commit 3083860b by Sixong.Zhu

update

parent 088c2b0c
......@@ -58,13 +58,11 @@ export default class ChatList extends Vue {
@chatStore.Mutation(ChatStore.MUTATION_CLEAR_CURRENT_CHAT_ID)
protected readonly clearCurrentChatId!: ChatStore.MUTATION_CLEAR_CURRENT_CHAT_ID;
private readonly invoker = Xim.getSdk();
protected parseMesage(data: ChatItem) {
if (data.last_msg_sender && data.last_msg_sender !== "0") {
if (this.userNames[data.last_msg_sender] === undefined) {
this.updateUserName({ id: data.last_msg_sender, name: "" });
this.invoker
Xim.getSdk()
.model("user")
.detail(data.last_msg_sender)
.query()
......@@ -74,7 +72,7 @@ export default class ChatList extends Vue {
name: userInfo.row.first_name.display as string,
});
})
.catch(() => {});
.catch(() => { });
}
}
if (data.last_msg_content === "") {
......
......@@ -14,6 +14,10 @@ class ChatCacheDatabaseController {
private readonly chatMessageKey = "chat-message";
public setup(uid: string) {
const qqxb = window.navigator.userAgent.toLowerCase().includes('qqxb');
if (qqxb) {
return Promise.resolve();
}
return new Promise<void>((resolve) => {
if (uid && indexedDB) {
const r = indexedDB.open(
......@@ -35,17 +39,17 @@ class ChatCacheDatabaseController {
}
resolve();
};
r.onsuccess = function (e) {
r.onsuccess = function(e) {
that.db = (e.target as any).result;
console.log(`index database init comepleted, 33%`);
setupDb();
};
r.onupgradeneeded = function (e) {
r.onupgradeneeded = function(e) {
that.db = (e.target as any).result;
console.log(`index database init comepleted, 66%`);
setupDb();
};
r.onerror = function (e) {
r.onerror = function(e) {
console.log(`index database init failed, ${e}`);
};
} else {
......@@ -72,17 +76,17 @@ class ChatCacheDatabaseController {
}
setTimeout(() => resolve(), 200);
};
r.onsuccess = function (e) {
r.onsuccess = function(e) {
const db = (e.target as any).result;
that.messageDatabases.set(k, db);
setupDb();
};
r.onupgradeneeded = function (e) {
r.onupgradeneeded = function(e) {
const db = (e.target as any).result;
that.messageDatabases.set(k, db);
setupDb();
};
r.onerror = function (e) {
r.onerror = function(e) {
console.log(
`chat message index database init failed, ${e}`
);
......
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