@albionlabs/chat-widget 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@
26
26
  let lastSeenMessageCount = $state(0);
27
27
  let signingIn = $state(false);
28
28
  let siweError = $state<string | null>(null);
29
+ let siweDismissed = $state(false);
29
30
 
30
31
  const httpBaseUrl = $derived(
31
32
  config.gatewayUrl.replace(/^ws:\/\//, 'http://').replace(/^wss:\/\//, 'https://')
@@ -59,11 +60,17 @@
59
60
  $effect(() => {
60
61
  const provider = $walletProvider;
61
62
  const authenticated = $auth.authenticated;
62
- if (provider && !authenticated && !signingIn) {
63
+ if (provider && !authenticated && !signingIn && !siweDismissed) {
63
64
  handleSiweLogin();
64
65
  }
65
66
  });
66
67
 
68
+ // Reset dismissed state when wallet provider changes
69
+ $effect(() => {
70
+ $walletProvider;
71
+ siweDismissed = false;
72
+ });
73
+
67
74
  // When auth completes, connect WebSocket
68
75
  $effect(() => {
69
76
  const authenticated = $auth.authenticated;
@@ -96,6 +103,7 @@
96
103
  if (!provider || signingIn) return;
97
104
 
98
105
  siweError = null;
106
+ siweDismissed = false;
99
107
  signingIn = true;
100
108
 
101
109
  try {
@@ -122,6 +130,7 @@
122
130
  setAuth(result.token, walletAddress, result.user.id);
123
131
  } catch (e) {
124
132
  siweError = e instanceof Error ? e.message : 'Sign-in failed';
133
+ siweDismissed = true;
125
134
  } finally {
126
135
  signingIn = false;
127
136
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const WIDGET_VERSION = "0.2.0";
1
+ export declare const WIDGET_VERSION = "0.2.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const WIDGET_VERSION = '0.2.0';
1
+ export const WIDGET_VERSION = '0.2.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albionlabs/chat-widget",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",