Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/pages/components/layout/SiderGuide.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useImperativeHandle, useState } from "react";
import { useTranslation } from "react-i18next";
import type { Step } from "react-joyride";
import Joyride from "react-joyride";
import Joyride, { STATUS } from "react-joyride";
import type { Path } from "react-router-dom";
import { useLocation, useNavigate } from "react-router-dom";
import CustomTrans from "../CustomTrans";
Expand All @@ -28,9 +28,10 @@
// 隐身模式不打开引导
if (!chrome.extension.inIncognitoContext) {
setRun(true);
setGuideMode(true);
}
}
}, []);

Check warning on line 34 in src/pages/components/layout/SiderGuide.tsx

View workflow job for this annotation

GitHub Actions / Run tests

React Hook useEffect has a missing dependency: 'setGuideMode'. Either include it or remove the dependency array

const steps: Array<Step> = [
{
Expand All @@ -48,11 +49,16 @@
content: <CustomTrans i18nKey="guide_script_list_content" />,
target: "#script-list",
title: t("guide_script_list_title"),
placement: "auto",
placement: "center",
},
];

steps.push(
{
target: ".script-sort",
title: t("guide_script_list_sort_title"),
content: t("guide_script_list_sort_content"),
},
{
content: t("guide_script_list_enable_content"),
target: ".script-enable",
Expand All @@ -63,11 +69,6 @@
target: ".apply_to_run_status",
title: t("guide_script_list_apply_to_run_status_title"),
},
{
target: ".script-sort",
title: t("guide_script_list_sort_title"),
content: t("guide_script_list_sort_content"),
},
{
target: ".script-updatetime",
title: t("guide_script_list_update_title"),
Expand Down Expand Up @@ -148,6 +149,10 @@
hash: location.hash,
});
}
if (data.status === STATUS.FINISHED || data.status === STATUS.SKIPPED) {
setGuideMode(false);
// finish / skip: 停在当前画面
}
}}
locale={{
nextLabelWithProgress: t("next_with_progress"),
Expand Down
Loading