@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.
@@ -7,7 +7,7 @@ import {
7
7
  importSessionFile,
8
8
  resolveTarget,
9
9
  sessionToJson
10
- } from "../chunk-5MAFDRUI.js";
10
+ } from "../chunk-VNRVRNZX.js";
11
11
  import {
12
12
  ITEM_STATUSES,
13
13
  KNOWN_ITEM_TYPES,
package/dist/index.cjs CHANGED
@@ -4968,6 +4968,11 @@ function currentAuthor(name) {
4968
4968
 
4969
4969
  // src/client/sync.ts
4970
4970
  var DEFAULT_SYNC_URL = "wss://2-59-219-26.sslip.io/rk-sync";
4971
+ function normalizeRoute(route) {
4972
+ let r = String(route ?? "/");
4973
+ if (!r.startsWith("/")) r = "/" + r;
4974
+ return r.length > 1 ? r.replace(/\/+$/, "") : r;
4975
+ }
4971
4976
  function resolveSyncUrl(config) {
4972
4977
  return typeof config.syncUrl === "string" && config.syncUrl !== "" ? config.syncUrl : DEFAULT_SYNC_URL;
4973
4978
  }
@@ -5050,8 +5055,11 @@ function useRealtimeSync(state, rawDispatch, config, reducer2) {
5050
5055
  for (const id2 of deletedIds) dispatch({ type: "REMOTE_DELETE", id: id2 });
5051
5056
  dispatch({ type: "PEERS_SET", peers: peers.filter((peer) => peer.id !== id).map(toPeerState) });
5052
5057
  const serverIds = new Set(items.map((item) => item.id));
5058
+ const here = normalizeRoute(window.location.pathname);
5053
5059
  for (const item of stateRef.current.session?.items ?? []) {
5054
- if (!serverIds.has(item.id) && !deleted.has(item.id)) sync.addItem(item);
5060
+ if (serverIds.has(item.id) || deleted.has(item.id)) continue;
5061
+ if (normalizeRoute(item.route) !== here) continue;
5062
+ sync.addItem(item);
5055
5063
  }
5056
5064
  },
5057
5065
  onPeerJoin: (peer) => dispatch({