diff --git a/src/components/Functions/Realtime/SubscribeChannel.vue b/src/components/Functions/Realtime/SubscribeChannel.vue index df61f6f..82147b9 100644 --- a/src/components/Functions/Realtime/SubscribeChannel.vue +++ b/src/components/Functions/Realtime/SubscribeChannel.vue @@ -94,15 +94,6 @@ :model-value="self" @update:modelValue="setSelf" /> - @@ -141,9 +132,6 @@ export default { self() { return this.args.self ?? false; }, - presence() { - return this.args.presence ?? false; - }, tablesOptions() { return [ { label: 'All tables', value: null }, @@ -173,7 +161,6 @@ export default { table: null, filter: null, self: false, - presence: false, }); }, setEvent(event) { @@ -191,9 +178,6 @@ export default { setSelf(self) { this.$emit('update:args', { ...this.args, self }); }, - setPresence(presence) { - this.$emit('update:args', { ...this.args, presence }); - }, async fetchTables() { try { this.isLoading = true; diff --git a/src/wwPlugin.js b/src/wwPlugin.js index 5aee3d8..4c98835 100644 --- a/src/wwPlugin.js +++ b/src/wwPlugin.js @@ -829,16 +829,7 @@ export default { return; } }, - subscribeToChannel({ - channel, - type = 'postgres_changes', - event = '*', - schema = '*', - table, - filter, - self = false, - presence = false, - }) { + subscribeToChannel({ channel, type = 'postgres_changes', event = '*', schema = '*', table, filter, self = false }) { const _channel = this.instance.channel(channel, { config: { broadcast: { self } } }); _channel.on( type, @@ -855,20 +846,18 @@ export default { }); } ); - if (presence) { - _channel.on( - 'presence', - { - event: '*', - }, - e => { - wwLib.wwWorkflow.executeTrigger(this.id + '-realtime:presence', { - event: { channel, data: e }, - conditions: { channel, event: e.event }, - }); - } - ); - } + _channel.on( + 'presence', + { + event: '*', + }, + e => { + wwLib.wwWorkflow.executeTrigger(this.id + '-realtime:presence', { + event: { channel, data: e }, + conditions: { channel, event: e.event }, + }); + } + ); _channel.subscribe(); }, unsubscribeFromChannel({ channel }) { @@ -877,7 +866,6 @@ export default { this.instance.removeChannel(_channel); }, sendMessageToChannel({ channel, type = 'broadcast', event, payload }) { - debugger; const _channel = this.instance.getChannels().find(c => c.subTopic === channel); if (!_channel) throw new Error('Channel not found, please subscribe to the channel before sending a message.'); _channel.send({ type, event, payload });