bitsnap-react 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3993,12 +3993,12 @@ function reducer(state, action) {
3993
3993
  return {
3994
3994
  ...state,
3995
3995
  groupsProvided: action.value,
3996
- groups: state.groups.filter(
3996
+ groups: action.value != null && action.value.length > 0 ? state.groups.filter(
3997
3997
  (group) => {
3998
3998
  var _a;
3999
3999
  return ((_a = action.value) == null ? void 0 : _a.find((g) => g.id === group.id)) != null;
4000
4000
  }
4001
- )
4001
+ ) : state.groups
4002
4002
  };
4003
4003
  }
4004
4004
  case "SET_GROUPS": {
@@ -4158,7 +4158,15 @@ function NotificationsComponentPublic(props) {
4158
4158
  }, [groupsDownloaded, isGroupsDownloading, props.groups]);
4159
4159
  const timeoutRef = useRef2(null);
4160
4160
  useEffect7(() => {
4161
- dispatch({ type: "SET_PUBLIC_GROUPS", value: props.groups });
4161
+ var _a2;
4162
+ let preparedGroups = (_a2 = props.groups) == null ? void 0 : _a2.map((el) => {
4163
+ if (el.id.startsWith("group_")) {
4164
+ return el;
4165
+ }
4166
+ el.id = `group_${el.id}`;
4167
+ return el;
4168
+ });
4169
+ dispatch({ type: "SET_PUBLIC_GROUPS", value: preparedGroups });
4162
4170
  }, [props.groups]);
4163
4171
  const {
4164
4172
  texts,