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

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;
@@ -5151,9 +5148,13 @@ const selectIndexIgnore = async (state, item) => {
5151
5148
  };
5152
5149
 
5153
5150
  const selectIndexNone = async (state, item) => {
5151
+ const {
5152
+ uid
5153
+ } = state;
5154
5154
  await executeMenuItemCommand(item);
5155
+ const latestState = get(uid)?.newState ?? state;
5155
5156
  return {
5156
- ...state,
5157
+ ...latestState,
5157
5158
  focusedIndex: -1,
5158
5159
  isMenuOpen: false,
5159
5160
  menus: []
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.9",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",