fixed bug in collection info updating
@@ -101,11 +101,19 @@ export class RumorReducer {
reduceCollection(json, state) {
if (json.who === window.ship) {
+ if (state.pubs[json.coll]) {
+ state.pubs[json.coll].info = json.data;
+ } else {
state.pubs[json.coll] = {
info: json.data,
order: { pin: [], unpin: [] },
posts: {},
}
+ }
+ } else {
+ if (state.subs[json.who]) {
+ if (state.subs[json.who][json.coll]) {
+ state.subs[json.who][json.coll].info = json.data;
} else {
state.subs[json.who][json.coll] = {
info: json.data,
@@ -113,6 +121,16 @@ export class RumorReducer {
posts: {},
}
}
+ } else {
+ state.subs[json.who] = {
+ [json.coll]: {
+ info: json.data,
+ order: { pin: [], unpin: [] },
+ posts: {},
+ }
+ }
+ }
+ }
}
reducePost(json, state) {
