feat: lots of updates

This commit is contained in:
zerosoul
2022-02-10 23:35:25 +08:00
parent e8b6c2b0f1
commit d05c5ff8f2
33 changed files with 1072 additions and 331 deletions
+9 -9
View File
@@ -1,18 +1,18 @@
import { createSlice } from "@reduxjs/toolkit";
const initialState = {};
const channelsSlice = createSlice({
name: "channels",
name: `channels`,
initialState,
reducers: {
setChannels(state, action) {
// console.log("set channels store", action);
const chs = action.payload;
chs.forEach((c) => {
const { gid, ...rest } = c;
console.log("wtf", gid, rest);
state[gid] = rest;
});
console.log("set channels store", state);
const chs = action.payload || [];
return Object.fromEntries(
chs.map((c) => {
const { gid, ...rest } = c;
return [gid, rest];
})
);
},
addChannel(state, action) {
// console.log("set channels store", action);