fix kiro fresh auto-run state reset
This commit is contained in:
@@ -437,6 +437,13 @@
|
||||
await chrome.tabs.update(tabId, { active: true });
|
||||
}
|
||||
|
||||
async function isSpecificTabAlive(tabId) {
|
||||
if (!Number.isInteger(tabId) || !chrome?.tabs?.get) {
|
||||
return false;
|
||||
}
|
||||
return Boolean(await chrome.tabs.get(tabId).catch(() => null));
|
||||
}
|
||||
|
||||
async function getExecutionState(state = {}) {
|
||||
if (state && typeof state === 'object' && !Array.isArray(state) && Object.keys(state).length) {
|
||||
return state;
|
||||
@@ -509,7 +516,8 @@
|
||||
: await getTabId(KIRO_REGISTER_PAGE_SOURCE_ID);
|
||||
const loginUrl = cleanString(runtimeState.register?.loginUrl);
|
||||
|
||||
if (Number.isInteger(tabId) && await isTabAlive(KIRO_REGISTER_PAGE_SOURCE_ID)) {
|
||||
if (Number.isInteger(tabId) && await isSpecificTabAlive(tabId)) {
|
||||
await registerTab(KIRO_REGISTER_PAGE_SOURCE_ID, tabId);
|
||||
return tabId;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,6 +204,17 @@
|
||||
const baseRuntimeState = isPlainObject(state?.runtimeState)
|
||||
? cloneValue(state.runtimeState)
|
||||
: {};
|
||||
delete baseRuntimeState.flowId;
|
||||
delete baseRuntimeState.runId;
|
||||
delete baseRuntimeState.activeFlowId;
|
||||
delete baseRuntimeState.activeRunId;
|
||||
delete baseRuntimeState.currentNodeId;
|
||||
delete baseRuntimeState.nodeStatuses;
|
||||
if (isPlainObject(baseRuntimeState.sharedState)) {
|
||||
delete baseRuntimeState.sharedState.tabRegistry;
|
||||
delete baseRuntimeState.sharedState.sourceLastUrls;
|
||||
delete baseRuntimeState.sharedState.flowStartTime;
|
||||
}
|
||||
const baseFlowState = isPlainObject(baseRuntimeState.flowState)
|
||||
? cloneValue(baseRuntimeState.flowState)
|
||||
: {};
|
||||
|
||||
Reference in New Issue
Block a user