Skip to content

Commit

Permalink
refresh profile + delete listing
Browse files Browse the repository at this point in the history
  • Loading branch information
summerthia committed Aug 10, 2022
2 parents bad1dea + c29a896 commit 7bd5ca5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/pages/chat_item_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ class _ChatItemPageState extends State<ChatItemPage> {
FirebaseFirestore.instance.collection("Reviews");
Query reviewDoc = reviewCollection
.where("listingId", isEqualTo: widget.listingId)
.where("reviewById", isEqualTo: currentUserId);
.where("reviewById", isEqualTo: currentUserId)
.where("reviewForId", isEqualTo: widget.otherId);
await reviewDoc.get().then((value) => {
if (value.docs.isEmpty)
{
Expand Down
21 changes: 12 additions & 9 deletions lib/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _LoginPageState extends State<LoginPage> {
late final TextEditingController _passwordController;

// local signin function
Future<void> _signIn() async {
Future<bool> _signIn() async {
setState(() {
_isLoading = true;
});
Expand All @@ -45,6 +45,8 @@ class _LoginPageState extends State<LoginPage> {
setState(() {
_isLoading = false;
});

return success;
}

@override
Expand Down Expand Up @@ -136,15 +138,16 @@ class _LoginPageState extends State<LoginPage> {
onPressed: _isLoading
? null
: () async {
_signIn();
bool success = await _signIn();
sleep(const Duration(seconds: 2));

Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProfilePage(
email: _emailController.text),
));
if (success) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProfilePage(
email: _emailController.text),
));
}
},
child: _isLoading
? const Center(
Expand Down

0 comments on commit 7bd5ca5

Please sign in to comment.