Skip to content

Commit

Permalink
do not set undefined to username if not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
foxriver76 committed Sep 25, 2023
1 parent 61e23b9 commit 2724a07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ For every shopping list a channel with the following states will be created:
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
* (foxriver76) fixed setting `undefined` state when no name specified

### 1.8.3 (2023-09-25)
* (foxriver76) Improve error messages

Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ async function tryLogin() {
try {
await bring.login();
await adapter.setState(`info.connection`, true, true);
await adapter.setState(`info.user`, bring.name, true);
adapter.log.info(`[LOGIN] Successfully logged in as ${bring.name}`);
await adapter.setState(`info.user`, bring.name ?? '', true);
adapter.log.info(`[LOGIN] Successfully logged in as ${bring.name ? bring.name : 'unknown'}`);
if (loginTimeout) {
clearTimeout(loginTimeout);
}
Expand Down

0 comments on commit 2724a07

Please sign in to comment.