@protobase/ui 0.25.0 → 0.25.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.
@@ -23,6 +23,7 @@ const Router = ({ basePath = "", initialUrl, children }) => {
23
23
  const position = useRef(memory ? 0 : historyIndex());
24
24
  const undoing = useRef(false);
25
25
  const proceeding = useRef(false);
26
+ const leaveAfterUndo = useRef(void 0);
26
27
  const [pending, setPending] = useState();
27
28
  useEffect(() => {
28
29
  if (memory) return;
@@ -32,6 +33,8 @@ const Router = ({ basePath = "", initialUrl, children }) => {
32
33
  if (undoing.current) {
33
34
  undoing.current = false;
34
35
  position.current = next;
36
+ if (leaveAfterUndo.current !== void 0) window.history.go(leaveAfterUndo.current);
37
+ leaveAfterUndo.current = void 0;
35
38
  return;
36
39
  }
37
40
  const delta = next - position.current;
@@ -78,7 +81,8 @@ const Router = ({ basePath = "", initialUrl, children }) => {
78
81
  setPending(void 0);
79
82
  if (pending.kind === "link") return go(pending.full, pending.replace);
80
83
  proceeding.current = true;
81
- window.history.go(pending.delta);
84
+ if (undoing.current) leaveAfterUndo.current = pending.delta;
85
+ else window.history.go(pending.delta);
82
86
  };
83
87
  const value = useMemo(() => {
84
88
  const parsed = new URL(url, "http://local");
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.25.0";
2
+ var version = "0.25.2";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };