diff --git a/app/components/user-menu.gjs b/app/components/user-menu.gjs index 9b44a00..cc76bbf 100644 --- a/app/components/user-menu.gjs +++ b/app/components/user-menu.gjs @@ -11,7 +11,7 @@ export default class UserMenuComponent extends Component { @action connectRS() { this.args.onClose(); - this.args.storage.connect(); + this.args.storage.showConnectWidget(); } @action diff --git a/app/services/storage.js b/app/services/storage.js index a739656..b360d92 100644 --- a/app/services/storage.js +++ b/app/services/storage.js @@ -46,6 +46,14 @@ export default class StorageService extends Service { // console.debug('[rs] client ready'); }); + this.rs.on('error', (error) => { + if (!error) return; + console.info('[rs] Error —', `${error.name}: ${error.message}`); + if (error.name === 'Unauthorized') { + this.showConnectWidget(); + } + }); + this.rs.on('connected', () => { this.connected = true; this.userAddress = this.rs.remote.userAddress; @@ -445,7 +453,7 @@ export default class StorageService extends Service { } @action - connect() { + showConnectWidget() { this.isWidgetOpen = true; // Check if widget is already attached