chore: remove unused console
This commit is contained in:
Vendored
+3
-3
@@ -39,7 +39,7 @@ const useRehydrate = () => {
|
||||
server: {}
|
||||
};
|
||||
const tables = Object.keys(window.CACHE);
|
||||
const results = await Promise.all(
|
||||
await Promise.all(
|
||||
tables.map((_key) => {
|
||||
return window.CACHE[_key]?.iterate((data: any, key) => {
|
||||
// console.log("iterated", key);
|
||||
@@ -87,7 +87,7 @@ const useRehydrate = () => {
|
||||
);
|
||||
dispatch(fillUsers(rehydrateData.users));
|
||||
dispatch(fillServer(rehydrateData.server));
|
||||
console.log("fill channels from indexedDB");
|
||||
// console.log("fill channels from indexedDB");
|
||||
dispatch(fillChannels(rehydrateData.channels));
|
||||
// file message
|
||||
dispatch(fillFileMessage(rehydrateData.fileMessage.list));
|
||||
@@ -99,7 +99,7 @@ const useRehydrate = () => {
|
||||
dispatch(fillReactionMessage(rehydrateData.reactionMessage));
|
||||
|
||||
setIterated(true);
|
||||
console.log("iterate results", rehydrateData, results);
|
||||
// console.log("iterate results", rehydrateData, results);
|
||||
};
|
||||
return { rehydrate, rehydrated: iterated };
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ export default async function handler({ operation, data = {} }: Params) {
|
||||
case "addFileMessage":
|
||||
case "removeFileMessage":
|
||||
{
|
||||
console.log("file message opt", data, operation);
|
||||
// console.log("file message opt", data, operation);
|
||||
await table?.setItem("list", data);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -13,7 +13,7 @@ export default async function handler({ operation, data = {} }: Params) {
|
||||
switch (operation) {
|
||||
case "toggleMenuExpand":
|
||||
{
|
||||
console.log("cache the toggleMenuExpand");
|
||||
// console.log("cache the toggleMenuExpand");
|
||||
await table?.setItem("menuExpand", data.menuExpand);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -46,7 +46,7 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => {
|
||||
// 先检查token是否过期,过期则renew
|
||||
const { token, refreshToken, expireTime = +new Date() } = api.getState().authData;
|
||||
let result = null;
|
||||
console.log("base check", whiteList.includes(api.endpoint), api.endpoint);
|
||||
// console.log("base check", whiteList.includes(api.endpoint), api.endpoint);
|
||||
if (!whiteList.includes(api.endpoint) && dayjs().isAfter(new Date(expireTime - 20 * 1000))) {
|
||||
// 快过期了,renew
|
||||
waitingForRenew = baseQuery(
|
||||
|
||||
@@ -22,7 +22,7 @@ export const onMessageSendStarted = async (
|
||||
// 忽略archive类型的消息
|
||||
if (type == "archive") return;
|
||||
// id: who send to ,from_uid: who sent
|
||||
console.log("handlers data", content, type, properties, ignoreLocal, id);
|
||||
// console.log("handlers data", content, type, properties, ignoreLocal, id);
|
||||
const isImage = properties.content_type?.startsWith("image");
|
||||
const ts = properties.local_id || +new Date();
|
||||
const tmpMsg = {
|
||||
@@ -45,7 +45,7 @@ export const onMessageSendStarted = async (
|
||||
|
||||
try {
|
||||
const { data: server_mid } = await queryFulfilled;
|
||||
console.log("message server mid", server_mid);
|
||||
// console.log("message server mid", server_mid);
|
||||
batch(() => {
|
||||
dispatch(removeContextMessage({ id, mid: ts }));
|
||||
dispatch(addMessage({ mid: server_mid, ...tmpMsg }));
|
||||
|
||||
@@ -34,10 +34,10 @@ export const userApi = createApi({
|
||||
try {
|
||||
const { data: users } = await queryFulfilled;
|
||||
const matchedUser = users.find((c) => c.uid == local_uid);
|
||||
console.log("wtf", users, matchedUser);
|
||||
// console.log("wtf", users, matchedUser);
|
||||
if (!matchedUser) {
|
||||
// 用户已注销或被禁用
|
||||
console.log("no matched user, redirect to login");
|
||||
// console.log("no matched user, redirect to login");
|
||||
dispatch(resetAuthData());
|
||||
} else {
|
||||
const markedUsers = users.map((u) => {
|
||||
|
||||
@@ -83,7 +83,7 @@ const messageSlice = createSlice({
|
||||
},
|
||||
addReplyingMessage(state, action: PayloadAction<{ key: string | number; mid: number }>) {
|
||||
const { key, mid } = action.payload;
|
||||
console.log("to ", key, mid);
|
||||
// console.log("to ", key, mid);
|
||||
state.replying[key] = mid;
|
||||
},
|
||||
removeReplyingMessage(state, action: PayloadAction<string | number>) {
|
||||
|
||||
@@ -39,13 +39,6 @@ const serverSlice = createSlice({
|
||||
},
|
||||
updateInfo(state, action: PayloadAction<Partial<StoredServer>>) {
|
||||
const values = action.payload || {};
|
||||
const tmp = { ...state, ...values };
|
||||
console.log("ssss", tmp);
|
||||
|
||||
// todo: check and remove old logic
|
||||
// Object.keys(values).forEach((_key) => {
|
||||
// state[_key] = values[_key];
|
||||
// });
|
||||
return { ...state, ...values };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user