Login/Register Screen blinking

Eduardo Gomez 3,651 Reputation points
2023-12-01T02:12:18.76+00:00

Hello

I am making a application with a claud database, o far everything seems to work.

Unfortunately I have a litte problem, and I don't see the problem

I am uing shell, and everytime I registe or log-in, I an see the log-in page for a millisecond, before going to the Home page

these are the method for login and register

    [RelayCommand]
    async Task Login() {

        IsElementVisible = false;
        IsBusy = true;
        //TODO change hard coded string in the view

        //var user = await authenticationService.LoginWithEmailAndPassword(Student.Email, Student.Password);
        var user = await authenticationService.LoginWithEmailAndPassword("******@admin.com", "111111");
        if (user != null) {

            await GetStudentAndNavigate(dataService, appService, appShellViewModel, user);

        }
        IsElementVisible = true;
        IsBusy = false;
    }

    [RelayCommand]
    async Task Register() {

        IsBusy = true;
        IsElementVisible = false;

        var user = await authenticationService.RegisterWithEmailAndPassword(Student.Email, Student.Password);
        if (user != null) {

            IsPopOpen = false;
            Student.Id = Student.GenerateRandomNumberString();
            Student.Email = Student.Email;
            Student.Password = BCrypt.Net.BCrypt.HashPassword(Student.Password);
            Student.Uid = user.Uid;

            await dataService.AddAsync("Users", Student);

            await GetStudentAndNavigate(dataService, appService, appShellViewModel, user);
        }
        IsElementVisible = true;
        IsBusy = false;
    }

Demo

https://reccloud.com/u/il173f7

code

https://github.com/eduardoagr/DemyAI

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
44,022 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Eduardo Gomez 3,651 Reputation points
    2023-12-04T18:25:05.85+00:00

    I already fixed it

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.