@openxiaobu/codexl 0.1.10 → 0.1.12

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.
Files changed (2) hide show
  1. package/dist/cli.js +9 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -105,6 +105,7 @@ async function handleInteractiveToggle() {
105
105
  }
106
106
  }
107
107
  (0, config_1.saveConfig)(latest);
108
+ changed = false;
108
109
  };
109
110
  render();
110
111
  const onKeypress = (_str, key) => {
@@ -121,26 +122,26 @@ async function handleInteractiveToggle() {
121
122
  if (key.name === "space") {
122
123
  accounts[cursor].enabled = !accounts[cursor].enabled;
123
124
  changed = true;
125
+ applyChanges();
124
126
  render();
125
127
  return;
126
128
  }
127
129
  if (key.name === "return" || key.name === "enter") {
128
- applyChanges();
130
+ if (changed) {
131
+ applyChanges();
132
+ }
129
133
  stdin.off("keypress", onKeypress);
130
134
  stdin.setRawMode?.(false);
131
- console.log("\n已保存账号启用状态变更。");
135
+ console.log("\n已退出账号启用状态编辑。");
132
136
  return;
133
137
  }
134
138
  if (key.name === "q" || (key.ctrl && key.name === "c")) {
135
- stdin.off("keypress", onKeypress);
136
- stdin.setRawMode?.(false);
137
139
  if (changed) {
138
140
  applyChanges();
139
- console.log("\n已保存账号启用状态变更。");
140
- }
141
- else {
142
- console.log("\n未做任何变更。");
143
141
  }
142
+ stdin.off("keypress", onKeypress);
143
+ stdin.setRawMode?.(false);
144
+ console.log("\n已退出账号启用状态编辑。");
144
145
  return;
145
146
  }
146
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openxiaobu/codexl",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "本地 Codex 多账号切换与状态管理工具",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cli.js",