@satanwagen/reviewkit 0.1.4 → 0.1.5

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/lazy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LazyReviewKit
3
- } from "./chunk-EOX3UJNP.js";
3
+ } from "./chunk-L7JLBD7Q.js";
4
4
  import "./chunk-ETAGGIDN.js";
5
5
  export {
6
6
  LazyReviewKit as ReviewKit
package/dist/next.cjs CHANGED
@@ -5075,6 +5075,11 @@ var init_identity = __esm({
5075
5075
  });
5076
5076
 
5077
5077
  // src/client/sync.ts
5078
+ function normalizeRoute(route) {
5079
+ let r = String(route ?? "/");
5080
+ if (!r.startsWith("/")) r = "/" + r;
5081
+ return r.length > 1 ? r.replace(/\/+$/, "") : r;
5082
+ }
5078
5083
  function resolveSyncUrl(config) {
5079
5084
  return typeof config.syncUrl === "string" && config.syncUrl !== "" ? config.syncUrl : DEFAULT_SYNC_URL;
5080
5085
  }
@@ -5153,8 +5158,11 @@ function useRealtimeSync(state, rawDispatch, config, reducer2) {
5153
5158
  for (const id2 of deletedIds) dispatch({ type: "REMOTE_DELETE", id: id2 });
5154
5159
  dispatch({ type: "PEERS_SET", peers: peers.filter((peer) => peer.id !== id).map(toPeerState) });
5155
5160
  const serverIds = new Set(items.map((item) => item.id));
5161
+ const here = normalizeRoute(window.location.pathname);
5156
5162
  for (const item of stateRef.current.session?.items ?? []) {
5157
- if (!serverIds.has(item.id) && !deleted.has(item.id)) sync.addItem(item);
5163
+ if (serverIds.has(item.id) || deleted.has(item.id)) continue;
5164
+ if (normalizeRoute(item.route) !== here) continue;
5165
+ sync.addItem(item);
5158
5166
  }
5159
5167
  },
5160
5168
  onPeerJoin: (peer) => dispatch({