Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/volt/tasks/live_query/live_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Tracks a channel and a query on a collection. Alerts
# the listener when the data in the query changes.
class LiveQuery
attr_reader :current_ids, :collection, :query
attr_reader :current_ids, :collection, :query, :channels

def initialize(pool, data_store, collection, query)
@pool = pool
Expand Down
4 changes: 4 additions & 0 deletions app/volt/tasks/query_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def initial_data
def remove_listener(collection, query)
live_query = @volt_app.live_query_pool.lookup(collection, query)
live_query.remove_channel(@channel)

# If query has no more channels remove it from channel_live_queries
@volt_app.channel_live_queries[@channel].delete(live_query) if live_query.channels.blank?
return true
end

# Removes a channel from all associated live queries
Expand Down