Skip to content

Commit

Permalink
Fix bug in anonymous read. Close #147
Browse files Browse the repository at this point in the history
  • Loading branch information
mauvaisetroupe committed Dec 18, 2023
1 parent 6faf179 commit 1b3e471
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.mauvaisetroupe.eadesignit</groupId>
<artifactId>ea-design-it</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>jar</packaging>
<name>EA Design It</name>
<description>Description for EA Design It</description>
Expand Down
9 changes: 7 additions & 2 deletions src/main/webapp/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ function retrieveAnonymousProperty(): Promise<boolean> {
});
} else {
const anonymousReadAllowed: boolean = _anonymousReadAllowedFromLocalStorage === 'true';
return new Promise(() => {
return anonymousReadAllowed;
console.log('_anonymousReadAllowedFromLocalStorage : ' + _anonymousReadAllowedFromLocalStorage);
console.log("_anonymousReadAllowedFromLocalStorage === 'true' : " + (_anonymousReadAllowedFromLocalStorage === 'true'));
return new Promise(resolve => {
resolve(anonymousReadAllowed);
});
}
}
Expand Down Expand Up @@ -88,11 +90,14 @@ const app = createApp({
const loginService = new LoginService({ emit });
provide('loginService', loginService);
const store = useStore();
store.setAnonymousReadAllowed(anonymousReadAllowedDefaultValue);
const accountService = new AccountService(store);

// Call retrieveAnonymousProperty and wait for result
retrieveAnonymousProperty().then(res => {
store.setAnonymousReadAllowed(res);
console.log('store.anonymousReadAllowed (after set) : ' + store.anonymousReadAllowed);
console.log('accountService.anonymousReadAllowed : ' + accountService.anonymousReadAllowed);
});

console.log('init Account done.');
Expand Down

0 comments on commit 1b3e471

Please sign in to comment.