@@ -7,6 +7,7 @@ import {AnalysisPreferenceModel, ComparisonPreferenceModel} from "../models/pref
7
7
import { SessionsList } from '../models/session_list'
8
8
import { Session } from '../models/session'
9
9
import { ProcessData } from "../analyses/sessions/process/types"
10
+ import { Config } from "../models/config"
10
11
11
12
const RELOAD_TIMEOUT = 60 * 1000
12
13
const FORCE_RELOAD_TIMEOUT = 5 * 1000
@@ -161,6 +162,25 @@ export class RunsListCache extends CacheObject<RunsList> {
161
162
await NETWORK . claimRun ( run . run_uuid )
162
163
this . invalidate_cache ( )
163
164
}
165
+
166
+ async localUpdateRun ( run : Run ) {
167
+ if ( this . data == null ) {
168
+ return
169
+ }
170
+
171
+ for ( let runItem of this . data . runs ) {
172
+ if ( runItem . run_uuid == run . run_uuid ) {
173
+ runItem . name = run . name
174
+ runItem . comment = run . comment
175
+ runItem . favorite_configs = [ ]
176
+ for ( let c of run . configs ) {
177
+ if ( run . favourite_configs . includes ( c . name ) ) {
178
+ runItem . favorite_configs . push ( new Config ( c ) )
179
+ }
180
+ }
181
+ }
182
+ }
183
+ }
164
184
}
165
185
166
186
export class SessionsListCache extends CacheObject < SessionsList > {
@@ -230,8 +250,8 @@ export class RunCache extends CacheObject<Run> {
230
250
return this . data
231
251
}
232
252
233
- async setRun ( run : Run ) : Promise < void > {
234
- await NETWORK . setRun ( this . uuid , run )
253
+ async updateRunData ( data : Record < string , any > ) : Promise < void > {
254
+ await NETWORK . updateRunData ( this . uuid , data )
235
255
}
236
256
}
237
257
0 commit comments