Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Hareesh-Nandigrama committed Aug 5, 2023
1 parent 37c51bb commit cb489a5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/pages/profile/edit_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class _EditProfileState extends State<EditProfile> {
}
Map userInfo = await APIService().getUserProfile();
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('hostel', hostel ?? "");
await prefs.setString("userInfo", jsonEncode(userInfo));
await context.read<LoginStore>().saveToUserInfo(
prefs); // automatically updates token & other user info
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/upsp/details_upsp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _DetailsUpspState extends State<DetailsUpsp> {
"Siang",
"Kapili",
"Dhansiri",
"Subhansiri",
"Subansiri",
"Married Scholar's Hostel"
];
final _formKey = GlobalKey<FormState>();
Expand Down
2 changes: 2 additions & 0 deletions lib/stores/login_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class LoginStore {
SharedPreferences user = await SharedPreferences.getInstance();
print("inside authentication check");
if (user.containsKey("userInfo")) {
Map userInfo = await APIService().getUserProfile();
await user.setString('userInfo', jsonEncode(userInfo));
print("here");
if(user.containsKey("isProfileComplete")){
print("PROFILE IS COMPLETE");
Expand Down
1 change: 0 additions & 1 deletion lib/stores/mess_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ abstract class _MessStore with Store {
static Future<String> getSavedHostel() async{
var prefs = await SharedPreferences.getInstance();
if (prefs.containsKey('hostel')) {
if(prefs.getString('hostel') == "Subansiri" || prefs.getString('hostel') == "Subhansiri")
if(prefs.getString('hostel')=="Brahma"){
return 'Brahmaputra';
}
Expand Down

0 comments on commit cb489a5

Please sign in to comment.