|
|
@@ -16,12 +16,14 @@ export function watch ({ productId, id }, cb, expired) {
|
|
|
listening = true
|
|
|
}
|
|
|
let inst = cache.get(id)
|
|
|
+ if (!inst || !inst.cb) {
|
|
|
+ subscribe(`${productId}/${id}/screenshot/reply`)
|
|
|
+ console.log('screenshot subscribe', id, '-> success')
|
|
|
+ }
|
|
|
if (inst) {
|
|
|
inst.cb = cb
|
|
|
} else {
|
|
|
- subscribe(`${productId}/${id}/screenshot/reply`)
|
|
|
cache.set(id, inst = createInst(productId, id, cb))
|
|
|
- console.log('screenshot subscribe', id, '-> success')
|
|
|
}
|
|
|
if (retry(inst, expired)) {
|
|
|
screenshot(id, true)
|