11import React , { useEffect , useImperativeHandle , useState } from "react" ;
22import { useTranslation } from "react-i18next" ;
33import type { Step } from "react-joyride" ;
4- import Joyride from "react-joyride" ;
4+ import Joyride , { STATUS } from "react-joyride" ;
55import type { Path } from "react-router-dom" ;
66import { useLocation , useNavigate } from "react-router-dom" ;
77import CustomTrans from "../CustomTrans" ;
@@ -28,6 +28,7 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
2828 // 隐身模式不打开引导
2929 if ( ! chrome . extension . inIncognitoContext ) {
3030 setRun ( true ) ;
31+ setGuideMode ( true ) ;
3132 }
3233 }
3334 } , [ ] ) ;
@@ -48,11 +49,16 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
4849 content : < CustomTrans i18nKey = "guide_script_list_content" /> ,
4950 target : "#script-list" ,
5051 title : t ( "guide_script_list_title" ) ,
51- placement : "auto " ,
52+ placement : "center " ,
5253 } ,
5354 ] ;
5455
5556 steps . push (
57+ {
58+ target : ".script-sort" ,
59+ title : t ( "guide_script_list_sort_title" ) ,
60+ content : t ( "guide_script_list_sort_content" ) ,
61+ } ,
5662 {
5763 content : t ( "guide_script_list_enable_content" ) ,
5864 target : ".script-enable" ,
@@ -63,11 +69,6 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
6369 target : ".apply_to_run_status" ,
6470 title : t ( "guide_script_list_apply_to_run_status_title" ) ,
6571 } ,
66- {
67- target : ".script-sort" ,
68- title : t ( "guide_script_list_sort_title" ) ,
69- content : t ( "guide_script_list_sort_content" ) ,
70- } ,
7172 {
7273 target : ".script-updatetime" ,
7374 title : t ( "guide_script_list_update_title" ) ,
@@ -148,6 +149,10 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
148149 hash : location . hash ,
149150 } ) ;
150151 }
152+ if ( data . status === STATUS . FINISHED || data . status === STATUS . SKIPPED ) {
153+ setGuideMode ( false ) ;
154+ // finish / skip: 停在当前画面
155+ }
151156 } }
152157 locale = { {
153158 nextLabelWithProgress : t ( "next_with_progress" ) ,
0 commit comments