diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index b690351..bc8afa2 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -16,9 +16,19 @@ export class AppComponent implements OnInit { // lang Lang.initLanguageSwitcher(); - // set default country and filename - await AsyncStorage.setItem('currentRecipeCountry', 'Thailand'); - await AsyncStorage.setItem('currentFile', 'default'); + // set default country and filename if empty + + let currentCountry = await AsyncStorage.getItem('currentRecipeCountry'); + let currentFile = await AsyncStorage.getItem('currentRecipeFile'); + + if (!currentCountry) { + await AsyncStorage.setItem('currentRecipeCountry', 'Thailand'); + } + + if (!currentFile) { + await AsyncStorage.setItem('currentRecipeFile', 'default'); + } + } } diff --git a/server/data/data.go b/server/data/data.go index c2a248f..b6810b8 100644 --- a/server/data/data.go +++ b/server/data/data.go @@ -98,6 +98,9 @@ func NewData(taoLogger *logger.TaoLogger, redisClient *RedisCli) *Data { // read latest version latest_version, _ := strconv.Atoi(initVersion) defaultForEachCountry = append(defaultForEachCountry, DefaultByCountry{CountryShortName: elem.CountryID, CountryLongName: elem.CountryName, DefaultFileVersion: latest_version}) + + // emit out latest version + taoLogger.Log.Info("Latest version", zap.Any("country", elem.CountryID), zap.Any("version", latest_version)) } currentFileMap := make(map[string]string)