11var modiferUrl = "" ;
2+ var countForVerifySave = 0 ;
3+ var countForVerifySaveSuccess = 0 ;
4+ var successVerifyNum = 3 ;
25
36function saveAndVerifyMain ( idForForm , modifier = "" )
47{
@@ -23,6 +26,7 @@ function saveAndVerifyMain(idForForm, modifier = "")
2326function verifySaveTimer ( )
2427{
2528 countForVerifySave = 0 ;
29+ countForVerifySaveSuccess = 0 ;
2630 pollCheckForUpdate = setInterval ( timerVerifySave , 3000 ) ;
2731}
2832
@@ -42,28 +46,16 @@ function timerVerifySave()
4246 {
4347 if ( data === true )
4448 {
45- clearInterval ( pollCheckForUpdate ) ;
46- if ( idForFormMain === "settingsMainWatch" )
49+ countForVerifySaveSuccess ++ ;
50+ if ( countForVerifySaveSuccess >= successVerifyNum )
4751 {
48- showPopupForCacheClear = false ;
49- clearCache ( ) ;
50- }
51- else
52- {
53- if ( document . getElementsByName ( "pollType" ) [ 0 ] )
54- {
55- if ( document . getElementsByName ( "pollType" ) [ 0 ] . value !== "2" )
56- {
57- document . getElementById ( "menuBarLeftSettingsServerWatchList" ) . style . display = "none" ;
58- }
59- else
60- {
61- document . getElementById ( "menuBarLeftSettingsServerWatchList" ) . style . display = "block" ;
62- }
63- }
64- saveVerified ( ) ;
52+ verifySuccess ( ) ;
6553 }
6654 }
55+ else
56+ {
57+ countForVerifySaveSuccess = 0 ;
58+ }
6759 } ,
6860 } ) ;
6961 }
@@ -74,6 +66,31 @@ function timerVerifySave()
7466 }
7567}
7668
69+ function verifySuccess ( )
70+ {
71+ clearInterval ( pollCheckForUpdate ) ;
72+ if ( idForFormMain === "settingsMainWatch" )
73+ {
74+ showPopupForCacheClear = false ;
75+ clearCache ( ) ;
76+ }
77+ else
78+ {
79+ if ( document . getElementsByName ( "pollType" ) [ 0 ] )
80+ {
81+ if ( document . getElementsByName ( "pollType" ) [ 0 ] . value !== "2" )
82+ {
83+ document . getElementById ( "menuBarLeftSettingsServerWatchList" ) . style . display = "none" ;
84+ }
85+ else
86+ {
87+ document . getElementById ( "menuBarLeftSettingsServerWatchList" ) . style . display = "block" ;
88+ }
89+ }
90+ saveVerified ( ) ;
91+ }
92+ }
93+
7794function saveVerified ( )
7895{
7996 saveSuccess ( ) ;
0 commit comments