@seafile/sdoc-editor 0.2.30-beta → 0.2.30-beta1

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.
@@ -31,7 +31,11 @@ var ViewChanges = function ViewChanges(_ref) {
31
31
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
32
32
  var item = _step.value;
33
33
  if (item[0] !== REVISION_DIFF_KEY) {
34
- newParamsString = newParamsString + "&".concat(item[0], "=").concat(item[1]);
34
+ if (newParamsString) {
35
+ newParamsString = newParamsString + "&".concat(item[0], "=").concat(item[1]);
36
+ } else {
37
+ newParamsString = "".concat(item[0], "=").concat(item[1]);
38
+ }
35
39
  }
36
40
  }
37
41
  } catch (err) {
@@ -40,9 +44,14 @@ var ViewChanges = function ViewChanges(_ref) {
40
44
  _iterator.f();
41
45
  }
42
46
  if (!searchParams.has(REVISION_DIFF_KEY) && nextIsShowChanges) {
43
- newParamsString = newParamsString + "&".concat(REVISION_DIFF_KEY, "=").concat(REVISION_DIFF_VALUE);
47
+ if (newParamsString) {
48
+ newParamsString = newParamsString + "&".concat(REVISION_DIFF_KEY, "=").concat(REVISION_DIFF_VALUE);
49
+ } else {
50
+ newParamsString = "".concat(REVISION_DIFF_KEY, "=").concat(REVISION_DIFF_VALUE);
51
+ }
44
52
  }
45
- var newURL = "".concat(url.origin).concat(url.pathname).concat(newParamsString ? '/?' + newParamsString : '');
53
+ var validPathName = url.pathname.endsWith('/') ? url.pathname : url.pathname + '/';
54
+ var newURL = "".concat(url.origin).concat(validPathName).concat(newParamsString ? '?' + newParamsString : '');
46
55
  window.history.replaceState(null, null, newURL);
47
56
  propsOnViewChangesToggle(nextIsShowChanges);
48
57
  // eslint-disable-next-line react-hooks/exhaustive-deps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.2.30beta",
3
+ "version": "0.2.30beta1",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",