refactor: rename contact with user

This commit is contained in:
Tristan Yang
2022-07-04 16:12:23 +08:00
parent 6083040e2b
commit 101dbdb5ee
76 changed files with 319 additions and 286 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ const tables = [
description: "store channel list"
},
{
storeName: "contacts",
description: "store contact list"
storeName: "users",
description: "store user list"
},
{
storeName: "messageDM",
+5 -5
View File
@@ -6,7 +6,7 @@ import { fullfillMessage } from "../slices/message";
import { fullfillChannelMsg } from "../slices/message.channel";
import { fullfillUserMsg } from "../slices/message.user";
import { fullfillChannels } from "../slices/channels";
import { fullfillContacts } from "../slices/contacts";
import { fullfillContacts } from "../slices/users";
import { fullfillFootprint } from "../slices/footprint";
import { fullfillFileMessage } from "../slices/message.file";
import { fullfillUI } from "../slices/ui";
@@ -17,7 +17,7 @@ const useRehydrate = () => {
const rehydrate = async () => {
const rehydrateData = {
channels: [],
contacts: [],
users: [],
fileMessage: {},
channelMessage: {},
userMessage: {},
@@ -38,9 +38,9 @@ const useRehydrate = () => {
rehydrateData.channels.push(data);
}
break;
case "contacts":
case "users":
if (data) {
rehydrateData.contacts.push(data);
rehydrateData.users.push(data);
}
break;
case "footprint":
@@ -75,7 +75,7 @@ const useRehydrate = () => {
})
);
batch(() => {
dispatch(fullfillContacts(rehydrateData.contacts));
dispatch(fullfillContacts(rehydrateData.users));
dispatch(fullfillServer(rehydrateData.server));
console.log("fullfill channels from indexedDB");
dispatch(fullfillChannels(rehydrateData.channels));