Substitute for-of with forEach

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
Josh-Cena 2021-06-18 22:25:49 +08:00
parent e7e9fa78e0
commit 8a4c6ac49e
No known key found for this signature in database
GPG key ID: C37145B818BDB68F

View file

@ -22,12 +22,12 @@ const useTabGroupChoice = (): useTabGroupChoiceReturns => {
useEffect(() => { useEffect(() => {
try { try {
const localStorageChoices = {}; const localStorageChoices = {};
for (const storageKey of listStorageKeys()) { listStorageKeys().forEach((storageKey) => {
if (storageKey.startsWith(TAB_CHOICE_PREFIX)) { if (storageKey.startsWith(TAB_CHOICE_PREFIX)) {
const groupId = storageKey.substring(TAB_CHOICE_PREFIX.length); const groupId = storageKey.substring(TAB_CHOICE_PREFIX.length);
localStorageChoices[groupId] = createStorageSlot(storageKey).get(); localStorageChoices[groupId] = createStorageSlot(storageKey).get();
} }
} });
setChoices(localStorageChoices); setChoices(localStorageChoices);
} catch (err) { } catch (err) {
console.error(err); console.error(err);