Changeset 56364 for branches/6.3
- Timestamp:
- 08/07/2023 04:52:56 PM (14 months ago)
- Location:
- branches/6.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.3
-
branches/6.3/src/js/_enqueues/lib/emoji-loader.js
r56119 r56364 74 74 */ 75 75 function getSessionSupportTests() { 76 if ( 77 typeof sessionStorage !== 'undefined' && 78 sessionStorageKey in sessionStorage 79 ) { 80 try { 81 /** @type {SessionSupportTests} */ 82 var item = JSON.parse( 83 sessionStorage.getItem( sessionStorageKey ) 84 ); 85 if ( 86 typeof item === 'object' && 87 typeof item.timestamp === 'number' && 88 new Date().valueOf() < item.timestamp + 604800 && // Note: Number is a week in seconds. 89 typeof item.supportTests === 'object' 90 ) { 91 return item.supportTests; 92 } 93 } catch ( e ) {} 94 } 76 try { 77 /** @type {SessionSupportTests} */ 78 var item = JSON.parse( 79 sessionStorage.getItem( sessionStorageKey ) 80 ); 81 if ( 82 typeof item === 'object' && 83 typeof item.timestamp === 'number' && 84 new Date().valueOf() < item.timestamp + 604800 && // Note: Number is a week in seconds. 85 typeof item.supportTests === 'object' 86 ) { 87 return item.supportTests; 88 } 89 } catch ( e ) {} 95 90 return null; 96 91 } … … 106 101 */ 107 102 function setSessionSupportTests( supportTests ) { 108 if ( typeof sessionStorage !== 'undefined' ) { 109 try { 110 /** @type {SessionSupportTests} */ 111 var item = { 112 supportTests: supportTests, 113 timestamp: new Date().valueOf() 114 }; 115 116 sessionStorage.setItem( 117 sessionStorageKey, 118 JSON.stringify( item ) 119 ); 120 } catch ( e ) {} 121 } 103 try { 104 /** @type {SessionSupportTests} */ 105 var item = { 106 supportTests: supportTests, 107 timestamp: new Date().valueOf() 108 }; 109 110 sessionStorage.setItem( 111 sessionStorageKey, 112 JSON.stringify( item ) 113 ); 114 } catch ( e ) {} 122 115 } 123 116
Note: See TracChangeset
for help on using the changeset viewer.