Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel authored Dec 9, 2024
1 parent a6097a6 commit 2057239
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,38 +572,6 @@ function init(t::Type{M};
else
return "An error has occured -- please check the logs"
end

field = Symbol(payload["field"])

#check if field exists
hasfield(CM, field) || return ok_response

valtype = Dict(zip(fieldnames(CM), CM.types))[field]
val = valtype <: Reactive ? getfield(model, field) : Ref{valtype}(getfield(model, field))

# reject non-public types
( isprivate(field, model) || isreadonly(field, model) ) && return ok_response

newval = convertvalue(val, payload["newval"])
oldval = try
convertvalue(val, payload["oldval"])
catch ex
val[]
end

push!(model, field => newval; channel = channel, except = client)
LAST_ACTIVITY[Symbol(channel)] = now()

try
update!(model, field, newval, oldval)
catch ex
# send the error to the frontend
if Genie.Configuration.isdev()
return ex
else
return "An error has occured -- please check the logs"
end
end
end
ok_response
end
Expand Down

0 comments on commit 2057239

Please sign in to comment.