diff options
Diffstat (limited to 'src/utils/search.ts')
-rw-r--r-- | src/utils/search.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/utils/search.ts b/src/utils/search.ts index aa9a7463..26f40b1b 100644 --- a/src/utils/search.ts +++ b/src/utils/search.ts @@ -1,12 +1,16 @@ import AsyncStorage from '@react-native-community/async-storage'; import {BADGE_DATA} from '../constants/badges'; -import {ProfilePreviewType, CategoryPreviewType, Universities} from '../types'; +import { + ProfilePreviewType, + CategoryPreviewType, + UniversityType, +} from '../types'; /* * Gets all possible search suggestions. */ -export const getSearchSuggestions = (university : Universities): string[] => { +export const getSearchSuggestions = (university: UniversityType): string[] => { const suggestions: string[] = []; for (const category of BADGE_DATA[university]) { for (const interest of category.data) { @@ -62,7 +66,9 @@ export const getRecentlySearchedUsers = async (): Promise< > => { try { const usersJSON = await AsyncStorage.getItem(recentlySearchedUsersKey); - if (usersJSON) return JSON.parse(usersJSON); + if (usersJSON) { + return JSON.parse(usersJSON); + } } catch (e) { console.log(e); } @@ -124,7 +130,9 @@ export const getRecentlySearchedCategories = async (): Promise< const categoriesJSON = await AsyncStorage.getItem( '@recently_searched_categories', ); - if (categoriesJSON) return JSON.parse(categoriesJSON); + if (categoriesJSON) { + return JSON.parse(categoriesJSON); + } } catch (e) { console.log(e); } |