( current: Partial<BootCacheData> | undefined, boot: Partial<BootCacheData>, )
| 85 | }; |
| 86 | |
| 87 | const updateLocalBootData = ( |
| 88 | current: Partial<BootCacheData> | undefined, |
| 89 | boot: Partial<BootCacheData>, |
| 90 | ) => { |
| 91 | const localData = { ...current, ...boot, lastModifier: 'extension' }; |
| 92 | if (localData.exp) { |
| 93 | const { f, ...exp } = localData.exp; |
| 94 | localData.exp = exp; |
| 95 | } |
| 96 | const result = filteredProps(localData, [ |
| 97 | 'alerts', |
| 98 | 'settings', |
| 99 | 'notifications', |
| 100 | 'user', |
| 101 | 'lastModifier', |
| 102 | 'squads', |
| 103 | 'exp', |
| 104 | 'feeds', |
| 105 | 'geo', |
| 106 | 'isAndroidApp', |
| 107 | 'accessTokenExpiresIn', |
| 108 | ]); |
| 109 | |
| 110 | storage.setItem(BOOT_LOCAL_KEY, JSON.stringify(result)); |
| 111 | |
| 112 | return result; |
| 113 | }; |
| 114 | |
| 115 | const getCachedOrNull = () => { |
| 116 | try { |
no test coverage detected