Synchronize resetCode for pair programming

This commit is contained in:
kiragrammel
2023-09-12 18:24:27 +02:00
committed by Sebastian Serth
parent cc90861bd5
commit f37ba34389
3 changed files with 20 additions and 0 deletions

View File

@ -46,6 +46,11 @@ class SynchronizedEditorChannel < ApplicationCable::Channel
ActionCable.server.broadcast(specific_channel, message)
end
def reset_content(content)
message = create_reset_content_message(content)
ActionCable.server.broadcast(specific_channel, message)
end
def create_message(action, status)
{
action:,
@ -54,4 +59,13 @@ class SynchronizedEditorChannel < ApplicationCable::Channel
session_id: @session_id,
}
end
def create_reset_content_message(content)
{
action: content['action'],
files: content['files'],
user: current_user.to_page_context,
session_id: @session_id,
}
end
end