feat: 取消跳过确认弹窗,简化操作逻辑

This commit is contained in:
QLHazyCoder
2026-04-11 17:27:27 +08:00
parent 1f91f6fcee
commit 5fec876a9f
+14 -11
View File
@@ -724,18 +724,15 @@ async function maybeTakeoverAutoRun(actionLabel) {
} }
async function handleSkipStep(step) { async function handleSkipStep(step) {
if (!(await maybeTakeoverAutoRun(`跳过步骤 ${step}`))) { if (isAutoRunPausedPhase()) {
return; const takeoverResponse = await chrome.runtime.sendMessage({
} type: 'TAKEOVER_AUTO_RUN',
source: 'sidepanel',
const confirmed = await openConfirmModal({ payload: {},
title: '跳过步骤',
message: `这不会真正执行步骤 ${step},只会直接跳过该步骤并放行后续步骤。是否继续?`,
confirmLabel: `跳过步骤 ${step}`,
confirmVariant: 'btn-primary',
}); });
if (!confirmed) { if (takeoverResponse?.error) {
return; throw new Error(takeoverResponse.error);
}
} }
const response = await chrome.runtime.sendMessage({ const response = await chrome.runtime.sendMessage({
@@ -1105,7 +1102,13 @@ btnTheme.addEventListener('click', () => {
initializeManualStepActions(); initializeManualStepActions();
initTheme(); initTheme();
updateToastOffset();
updateSaveButtonState(); updateSaveButtonState();
window.addEventListener('resize', updateToastOffset);
window.addEventListener('load', updateToastOffset);
if (document.fonts?.ready) {
document.fonts.ready.then(updateToastOffset).catch(() => { });
}
restoreState().then(() => { restoreState().then(() => {
syncPasswordToggleLabel(); syncPasswordToggleLabel();
syncVpsUrlToggleLabel(); syncVpsUrlToggleLabel();