feat: 取消跳过确认弹窗,简化操作逻辑
This commit is contained in:
+14
-11
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user