File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1307,20 +1307,11 @@ function getAutoSavedKey () {
13071307}
13081308
13091309function checkSavedQuery ( ) {
1310- let key = Sql . getAutoSavedKey ( ) ;
1311- let buttonGetAutoSavedQuery = $ ( '#saved' ) ;
1312-
1313- let isAutoSavedInLocalStorage = isStorageSupported ( 'localStorage' ) && ( typeof window . localStorage . getItem ( key ) === 'string' ) ;
1314- // @ts -ignore
1315- let isAutoSavedInCookie = window . Cookies . get ( key , { path : CommonParams . get ( 'rootPath' ) } ) ;
1316-
1317- if ( isAutoSavedInLocalStorage || isAutoSavedInCookie ) {
1318- buttonGetAutoSavedQuery . prop ( 'disabled' , false ) ;
1319-
1320- return ;
1321- }
1322-
1323- buttonGetAutoSavedQuery . prop ( 'disabled' , true ) ;
1310+ const key = Sql . getAutoSavedKey ( ) ;
1311+ const haveAutoSavedQuery =
1312+ ( isStorageSupported ( 'localStorage' ) && typeof window . localStorage . getItem ( key ) === 'string' ) ||
1313+ window . Cookies . withAttributes ( { path : CommonParams . get ( 'rootPath' ) } ) . get ( key ) ;
1314+ $ ( '#saved' ) . prop ( 'disabled' , ! haveAutoSavedQuery ) ;
13241315}
13251316
13261317AJAX . registerOnload ( 'sql.js' , function ( ) {
You can’t perform that action at this time.
0 commit comments