Skip to content

Commit

Permalink
Go to homepage after user authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
javierllorente committed Oct 16, 2024
1 parent 4acd700 commit 0bafc78
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/main/java/com/javierllorente/obsfx/BrowserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ public void initialize(URL url, ResourceBundle rb) {
initPackageListView();
initTabPane();

String username = preferences.get(App.USERNAME, "");
if (!username.isBlank()) {
String homepage = preferences.get(App.HOMEPAGE, "home:" + username);
locationTextField.setText(homepage);
}

Platform.runLater(() -> {
locationTextField.requestFocus();
locationTextField.end();
Expand Down Expand Up @@ -712,10 +706,7 @@ public void startProjectsTask() {
progressIndicator.setVisible(true);
new Thread(projectsTask).start();
projectsTask.setOnSucceeded((t) -> {
projects = projectsTask.getValue();
String homepage = preferences.get(App.HOMEPAGE,
"home:" + App.getOBS().getUsername());
goTo(homepage);
projects = projectsTask.getValue();
progressIndicator.setVisible(false);
});
projectsTask.setOnFailed((t) -> {
Expand Down Expand Up @@ -853,6 +844,9 @@ protected Void call() throws Exception {
protected void succeeded() {
super.succeeded();
if (App.getOBS().isAuthenticated()) {
String homepage = preferences.get(App.HOMEPAGE,
"home:" + App.getOBS().getUsername());
goTo(homepage);
startProjectsTask();
loadBookmarks();
} else {
Expand Down

0 comments on commit 0bafc78

Please sign in to comment.