From b245f35cc58d1125d327cad87732741ad5822a05 Mon Sep 17 00:00:00 2001 From: hhaensel Date: Wed, 6 Nov 2024 15:45:24 +0100 Subject: [PATCH 1/2] add autofield :ws_disconnected --- src/Stipple.jl | 3 ++- src/stipple/reactivity.jl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Stipple.jl b/src/Stipple.jl index 0f48b0eb..71ec16ac 100644 --- a/src/Stipple.jl +++ b/src/Stipple.jl @@ -460,7 +460,8 @@ function init_storage() :modes__ => :(modes__::Stipple.LittleDict{Symbol,Int} = Stipple.LittleDict{Symbol,Int}()), :isready => :(isready::Stipple.R{Bool} = false), :isprocessing => :(isprocessing::Stipple.R{Bool} = false), - :fileuploads => :(fileuploads::Stipple.R{Dict{AbstractString,AbstractString}} = Dict{AbstractString,AbstractString}()) + :fileuploads => :(fileuploads::Stipple.R{Dict{AbstractString,AbstractString}} = Dict{AbstractString,AbstractString}()), + :ws_disconnected => :(ws_disconnected::Stipple.R{Bool} = false) ) end diff --git a/src/stipple/reactivity.jl b/src/stipple/reactivity.jl index a4286fb4..55a373e2 100644 --- a/src/stipple/reactivity.jl +++ b/src/stipple/reactivity.jl @@ -171,7 +171,7 @@ function setchannel(m::M, value) where {M<:ReactiveModel} setfield!(m, CHANNELFIELDNAME, ChannelName(value)) end -const AUTOFIELDS = [:isready, :isprocessing, :fileuploads] # not DRY but we need a reference to the auto-set fields +const AUTOFIELDS = [:isready, :isprocessing, :fileuploads, :ws_disonnected] # not DRY but we need a reference to the auto-set fields const INTERNALFIELDS = [CHANNELFIELDNAME, :modes__] # not DRY but we need a reference to the auto-set fields @pour reactors begin @@ -181,6 +181,7 @@ const INTERNALFIELDS = [CHANNELFIELDNAME, :modes__] # not DRY but we need a refe isprocessing::Stipple.R{Bool} = false channel_::String = "" # not sure what this does if it's empty fileuploads::Stipple.R{Dict{AbstractString,AbstractString}} = Dict{AbstractString,AbstractString}() + ws_disconnected::Stipple.R{Bool} = false end @mix Stipple.@with_kw mutable struct old_reactive From 07af99416c46237b364d306a935bb85f96ad8bdf Mon Sep 17 00:00:00 2001 From: hhaensel Date: Wed, 6 Nov 2024 16:01:55 +0100 Subject: [PATCH 2/2] fix typo --- src/stipple/reactivity.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stipple/reactivity.jl b/src/stipple/reactivity.jl index 55a373e2..89ed9057 100644 --- a/src/stipple/reactivity.jl +++ b/src/stipple/reactivity.jl @@ -171,7 +171,7 @@ function setchannel(m::M, value) where {M<:ReactiveModel} setfield!(m, CHANNELFIELDNAME, ChannelName(value)) end -const AUTOFIELDS = [:isready, :isprocessing, :fileuploads, :ws_disonnected] # not DRY but we need a reference to the auto-set fields +const AUTOFIELDS = [:isready, :isprocessing, :fileuploads, :ws_disconnected] # not DRY but we need a reference to the auto-set fields const INTERNALFIELDS = [CHANNELFIELDNAME, :modes__] # not DRY but we need a reference to the auto-set fields @pour reactors begin