local-lite 0.2.3 → 0.2.5

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.
@@ -558,6 +558,17 @@ class SupabaseRemoteAdapter {
558
558
  catch { }
559
559
  this.activeChannel = undefined;
560
560
  }
561
+ if (client?.getChannels && client?.removeChannel) {
562
+ try {
563
+ const existingChannels = client.getChannels();
564
+ for (const ch of existingChannels) {
565
+ if (ch.topic?.includes(this.channelName)) {
566
+ client.removeChannel(ch);
567
+ }
568
+ }
569
+ }
570
+ catch { }
571
+ }
561
572
  if (!client || typeof client.channel !== 'function') {
562
573
  this.logger.debug('Supabase client is not available; skipping live changes subscription.');
563
574
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "local-lite",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Never let a lost connection break a promise. Local-first sync that faithfully keeps data safe until you're back online.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",