File tree Expand file tree Collapse file tree 1 file changed +26
-24
lines changed
ghcjs/delivery-calculator/src Expand file tree Collapse file tree 1 file changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -124,42 +124,40 @@ updateModel (Tick f) st =
124
124
sleepSeconds 1
125
125
ct <- getCurrentTime
126
126
pure . Tick $ # modelTime .~ ct
127
- updateModel (InitUpdate ext ) prevSt = do
127
+ updateModel (InitUpdate mShortSt ) prevSt = do
128
128
effectSub prevSt $ \ sink -> do
129
129
liftIO . sink $ Tick id
130
130
mvSink <- newMVar sink
131
131
let nextSt = prevSt {modelSink = mvSink}
132
- if isJust ext
133
- then do
132
+ Jsm. selectStorage ( " current- " <> vsn) $ \ case
133
+ Nothing -> do
134
134
liftIO
135
135
. sink
136
136
. PushUpdate
137
137
. PureUpdate
138
138
$ # modelLoading
139
139
.~ False
140
140
opfsSync sink nextSt
141
- else Jsm. selectStorage (" current-" <> vsn) $ \ case
142
- Nothing -> do
143
- liftIO
144
- . sink
145
- . PushUpdate
146
- . PureUpdate
147
- $ # modelLoading
148
- .~ False
149
- opfsSync sink nextSt
150
- Just uri -> do
151
- mSt <- unLongUri uri
152
- finSt <- newModel (nextSt ^. # modelWebOpts) mvSink (Just nextSt) mSt
153
- liftIO
154
- . sink
155
- . PushUpdate
156
- . PureUpdate
157
- $ ( const
158
- $ finSt
159
- & # modelLoading
160
- .~ False
141
+ Just uri -> do
142
+ mLongSt <- unLongUri uri
143
+ let st =
144
+ ( mShortSt <|> mLongSt
161
145
)
162
- opfsSync sink finSt
146
+ & _Just
147
+ . # stAssets
148
+ .~ ( fromMaybe mempty $ mLongSt ^? _Just . # stAssets
149
+ )
150
+ finSt <- newModel (nextSt ^. # modelWebOpts) mvSink (Just nextSt) st
151
+ liftIO
152
+ . sink
153
+ . PushUpdate
154
+ . PureUpdate
155
+ $ ( const
156
+ $ finSt
157
+ & # modelLoading
158
+ .~ False
159
+ )
160
+ opfsSync sink finSt
163
161
liftIO
164
162
. sink
165
163
. PushUpdate
@@ -210,6 +208,10 @@ updateModel (EvalUpdate f) st = do
210
208
& # fieldPairValue
211
209
. # fieldType
212
210
.~ FieldTypeQrCode
211
+ & # fieldPairValue
212
+ . # fieldOpts
213
+ . # fieldOptsTruncateLimit
214
+ .~ Nothing
213
215
],
214
216
do
215
217
--
You can’t perform that action at this time.
0 commit comments