File tree Expand file tree Collapse file tree 1 file changed +24
-12
lines changed
Expand file tree Collapse file tree 1 file changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -246,21 +246,33 @@ async function exportPredicate(
246246 console . log ( oldPredicate )
247247 // @ts -ignore
248248 const data = oldPredicate ?. aj ?. includedRigs || { }
249- Object . entries ( data ) . forEach ( ( [ id , dat ] ) => {
250- let ids = dat . usedIDs
251- // @ts -ignore
252- if ( id !== Project . UUID ) {
253- for ( let i = 0 ; i < ids . length ; i ++ ) {
254- if ( Array . isArray ( ids [ i ] ) ) {
255- for ( let k = ids [ i ] [ 0 ] ; k <= ids [ i ] [ 1 ] ; k ++ ) {
256- usedIDs . push ( k )
249+ if ( ! oldPredicate ?. aj ?. includedRigs ) {
250+ data . preExistingIds = {
251+ name : 'preExistingIds' ,
252+ usedIDs : packArr (
253+ oldPredicate . overrides . map ( ( override ) => {
254+ usedIDs . push ( override . predicate . custom_model_data )
255+ return override . predicate . custom_model_data
256+ } )
257+ ) ,
258+ }
259+ } else {
260+ Object . entries ( data ) . forEach ( ( [ id , dat ] ) => {
261+ let ids = dat . usedIDs
262+ // @ts -ignore
263+ if ( id !== Project . UUID ) {
264+ for ( let i = 0 ; i < ids . length ; i ++ ) {
265+ if ( Array . isArray ( ids [ i ] ) ) {
266+ for ( let k = ids [ i ] [ 0 ] ; k <= ids [ i ] [ 1 ] ; k ++ ) {
267+ usedIDs . push ( k )
268+ }
269+ } else {
270+ usedIDs . push ( ids [ i ] )
257271 }
258- } else {
259- usedIDs . push ( ids [ i ] )
260272 }
261273 }
262- }
263- } )
274+ } )
275+ }
264276 // @ts -ignore
265277 delete data [ Project . UUID ]
266278 predicateJSON . aj . includedRigs = data
You can’t perform that action at this time.
0 commit comments