# if not, drop new_info's dependency on push
old_info: (cb) => @api 'app_info', old_app, cb
new_info: ['push', (cb) => @api 'app_info', new_app, cb ]
- start_new: ['push', 'old_info', 'new_info', (cb, args) =>
- args.new_info.state = 'STARTED'
+ copy_uris: ['push', 'old_info', 'new_info', (cb, args) =>
+ # There's a bug in the server where you can't set new uris and
+ # start the app in the same app_set_info call
for u in args.old_info.uris
args.new_info.uris.push u unless u.substr(-6) is '.af.cm'
@api 'app_set_info', new_app, args.new_info, cb
]
+ new_info_again: ['copy_uris', (cb, args) =>
+ @api 'app_info', new_app, cb
+ ]
+ start_new: ['new_info_again', (cb, args) =>
+ args.new_info_again.state = 'STARTED'
+ @api 'app_set_info', new_app, args.new_info_again, cb
+ ]
hide_old: ['start_new', 'old_info', (cb, args) =>
just_af = []
for u in args.old_info.uris