@lvce-editor/title-bar-worker 4.15.7 → 4.15.8

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.
@@ -3927,10 +3927,7 @@ const getRemoteSshWorkspace = workspaceUri => {
3927
3927
  };
3928
3928
  const getWorkspaceTitle = (workspacePath, titleTemplate, appName) => {
3929
3929
  const endIndex = getEndIndex(workspacePath);
3930
- const slashIndex = workspacePath.lastIndexOf('/', endIndex - 1);
3931
- if (slashIndex === -1) {
3932
- return '';
3933
- }
3930
+ const slashIndex = Math.max(workspacePath.lastIndexOf('/', endIndex - 1), workspacePath.lastIndexOf('\\', endIndex - 1));
3934
3931
  const folderName = workspacePath.slice(slashIndex + 1, endIndex);
3935
3932
 
3936
3933
  // If titleTemplate is empty, return folderName directly
@@ -3946,13 +3943,13 @@ const getWorkspaceTitle = (workspacePath, titleTemplate, appName) => {
3946
3943
  };
3947
3944
  const getTitle = (workspaceUri, titleTemplate, appName) => {
3948
3945
  if (!workspaceUri) {
3949
- return '';
3946
+ return appName;
3950
3947
  }
3951
3948
  const remoteSshWorkspace = getRemoteSshWorkspace(workspaceUri);
3952
3949
  const workspacePath = remoteSshWorkspace?.path ?? workspaceUri;
3953
3950
  const title = getWorkspaceTitle(workspacePath, titleTemplate, appName);
3954
3951
  if (!remoteSshWorkspace) {
3955
- return title;
3952
+ return title || appName;
3956
3953
  }
3957
3954
  const remoteSuffix = `[SSH: ${remoteSshWorkspace.host}]`;
3958
3955
  return title ? `${title} ${remoteSuffix}` : remoteSuffix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "4.15.7",
3
+ "version": "4.15.8",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",