finch-git-branch 0.3.2 → 0.3.3
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.
- package/dist/scm-panel.js +8 -8
- package/package.json +1 -1
package/dist/scm-panel.js
CHANGED
|
@@ -185,12 +185,12 @@ export function activateScmPanel(ctx) {
|
|
|
185
185
|
// Also push config immediately: an already-live Webview may not emit finch:env again
|
|
186
186
|
// after the mini tool backend is reloaded.
|
|
187
187
|
void sendConfig().catch(() => undefined);
|
|
188
|
-
const setScope = async (message
|
|
189
|
-
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
const nextCwd =
|
|
188
|
+
const setScope = async (message) => {
|
|
189
|
+
// A Panel belongs to the Session that opened it. Its bridged finch:env cwd
|
|
190
|
+
// remains the only reliable scope after switching other Spaces/Sessions;
|
|
191
|
+
// ctx.workspace describes the globally active workspace and can belong to
|
|
192
|
+
// a different Session by the time this callback runs.
|
|
193
|
+
const nextCwd = typeof message.cwd === 'string' ? message.cwd : '';
|
|
194
194
|
const nextScopeKey = typeof message.scopeKey === 'string' ? message.scopeKey : (scopeKey || nextCwd);
|
|
195
195
|
if (nextScopeKey === scopeKey && nextCwd === cwd)
|
|
196
196
|
return false;
|
|
@@ -268,12 +268,12 @@ export function activateScmPanel(ctx) {
|
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
270
|
if (message.type === 'refresh') {
|
|
271
|
-
await setScope(message
|
|
271
|
+
await setScope(message);
|
|
272
272
|
await refresh(message.silent !== true);
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
if (message.type === 'syncWorkspace') {
|
|
276
|
-
const changed = await setScope(message
|
|
276
|
+
const changed = await setScope(message);
|
|
277
277
|
await sendConfig();
|
|
278
278
|
if (changed || repos.length === 0)
|
|
279
279
|
await refresh();
|