@lvce-editor/renderer-process 30.68.12 → 30.68.13

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.
@@ -10502,15 +10502,25 @@ const setHash = hash => {
10502
10502
  }
10503
10503
  history.replaceState(null, '', url.href);
10504
10504
  };
10505
- const setWorkspaceUri = workspaceUri => {
10505
+ const setWorkspaceUri = _workspaceUri => {
10506
10506
  const currentHref = getHref();
10507
10507
  const url = new URL(currentHref);
10508
- url.searchParams.set('workspace', workspaceUri);
10508
+ url.searchParams.delete('workspace');
10509
10509
  if (url.href === currentHref) {
10510
10510
  return;
10511
10511
  }
10512
10512
  history.replaceState(null, '', url.href);
10513
10513
  };
10514
+ const removeWorkspaceUri = () => {
10515
+ const currentHref = getHref();
10516
+ const url = new URL(currentHref);
10517
+ if (!url.searchParams.has('workspace')) {
10518
+ return currentHref;
10519
+ }
10520
+ url.searchParams.delete('workspace');
10521
+ history.replaceState(null, '', url.href);
10522
+ return getHref();
10523
+ };
10514
10524
  const isChatPath = pathName => {
10515
10525
  return /(?:^|\/)chat\/?$/.test(pathName);
10516
10526
  };
@@ -10540,9 +10550,11 @@ const getConfig = () => {
10540
10550
  return JSON.parse(configElement.textContent);
10541
10551
  };
10542
10552
  const getInitData = () => {
10553
+ const config = getConfig();
10554
+ const href = config.platform === 'electron' ? removeWorkspaceUri() : getHref();
10543
10555
  const initData = {
10544
10556
  Config: {
10545
- ...getConfig(),
10557
+ ...config,
10546
10558
  assetDir: assetDir,
10547
10559
  platform: platform,
10548
10560
  shouldLaunchMultipleWorkers: shouldLaunchMultipleWorkers,
@@ -10553,7 +10565,7 @@ const getInitData = () => {
10553
10565
  bounds: getBounds()
10554
10566
  },
10555
10567
  Location: {
10556
- href: getHref()
10568
+ href
10557
10569
  }
10558
10570
  };
10559
10571
  return initData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.68.12",
3
+ "version": "30.68.13",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"