Skip to content

Commit

Permalink
fix: navigating back to homescreen even after successfull login
Browse files Browse the repository at this point in the history
  • Loading branch information
IamMuuo committed Sep 24, 2024
1 parent 7829966 commit 6f24e7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/pages/auth/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class _LoginPageState extends State<LoginPage> {
HapticFeedback.heavyImpact().then((value) {
if (userController.isLoggedIn.value) {
if (!mounted) return;
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => const LayoutPage(),
),
);
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (context) => const LayoutPage()),
(predicate) => false
// (Route<dynamic route>) => false,
);
return;
}
});
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/auth/register_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ class _RegisterPageState extends State<RegisterPage> {
}, (r) {
if (r && userController.isLoggedIn.value) {
HapticFeedback.heavyImpact().then((value) {});
Navigator.of(context).pushReplacement(
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) => const LayoutPage(),
),
(predicate) => false,
);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/chirp/models/services/chirp_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ChirpService {
static const urlPrefix = "http://192.168.2.115:8080";
static const urlPrefix = "http://127.0.0.1:8080";
// static const urlPrefix = "http://62.169.16.219:84";
}

0 comments on commit 6f24e7a

Please sign in to comment.