Skip to content

Commit

Permalink
production config
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmtsk committed Jun 15, 2021
1 parent b9c4cfa commit 708d30e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/common/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const config = {
api: 'http://laravel.test/api',
api: 'https://api.voteswiper.org/api',
apiVersion: 1,
apiUrl: 'https://www.voteswiper.org/!',
fallbackLocale: 'en',
locales: ['en', 'de', 'fr', 'fi', 'sv'],
storyblokAccessToken: 'b7BTTUOEkSa786viucYnjwtt',
Expand Down
16 changes: 8 additions & 8 deletions src/contexts/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ const AppProvider: React.FC = ({children}) => {

React.useEffect(() => {
const fetchFromStorage = async () => {
const storedCountry = await AsyncStorage.getItem('@defaultCountry');
const storedCountry = await AsyncStorage.getItem('@defaultCountry330');
const storedLanguageNotice = await AsyncStorage.getItem(
'@languageNotice',
'@languageNotice330',
);
const storedLanguage = await AsyncStorage.getItem('@language');
const storedLanguage = await AsyncStorage.getItem('@language330');

setCountry(storedCountry !== null ? JSON.parse(storedCountry) : null);

Expand All @@ -57,9 +57,9 @@ const AppProvider: React.FC = ({children}) => {
initialCountryCheck.current = false;
} else {
if (country === null) {
AsyncStorage.removeItem('@defaultCountry');
AsyncStorage.removeItem('@defaultCountry330');
} else {
AsyncStorage.setItem('@defaultCountry', JSON.stringify(country));
AsyncStorage.setItem('@defaultCountry330', JSON.stringify(country));
}
}
}, [country]);
Expand All @@ -70,9 +70,9 @@ const AppProvider: React.FC = ({children}) => {
initialLanguageCheck.current = false;
} else {
if (language === null) {
AsyncStorage.removeItem('@language');
AsyncStorage.removeItem('@language330');
} else {
AsyncStorage.setItem('@language', language).catch((err) =>
AsyncStorage.setItem('@language330', language).catch((err) =>
console.log(err),
);
}
Expand All @@ -81,7 +81,7 @@ const AppProvider: React.FC = ({children}) => {

// persist language
React.useEffect(() => {
AsyncStorage.setItem('@languageNotice', JSON.stringify(languageNotice));
AsyncStorage.setItem('@languageNotice330', JSON.stringify(languageNotice));
}, [languageNotice]);

const setLocale = React.useCallback((loc: string | null) => {
Expand Down

0 comments on commit 708d30e

Please sign in to comment.