Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions assets/js/phoenix_live_view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,9 @@ export default class View {
event: phxEvent,
value: this.extractMeta(el, meta, opts.value),
cid: this.targetComponentID(el, targetCtx, opts)
}).then(({reply}) => onReply && onReply(reply))
})
.then(({reply}) => onReply && onReply(reply))
.catch((error) => logError("Failed to push event", error))
}

pushFileProgress(fileEl, entryRef, progress, onReply = function (){ }){
Expand All @@ -1177,7 +1179,9 @@ export default class View {
entry_ref: entryRef,
progress: progress,
cid: view.targetComponentID(fileEl.form, targetCtx)
}).then(({resp}) => onReply(resp))
})
.then(({resp}) => onReply(resp))
.catch((error) => logError("Failed to push file progress", error))
})
}

Expand Down Expand Up @@ -1242,7 +1246,7 @@ export default class View {
} else {
callback && callback(resp)
}
})
}).catch((error) => logError("Failed to push input event", error))
}

triggerAwaitingSubmit(formEl, phxEvent){
Expand Down Expand Up @@ -1341,7 +1345,9 @@ export default class View {
value: formData,
meta: meta,
cid: cid
}).then(({resp}) => onReply(resp))
})
.then(({resp}) => onReply(resp))
.catch((error) => logError("Failed to push form submit", error))
})
} else if(!(formEl.hasAttribute(PHX_REF_SRC) && formEl.classList.contains("phx-submit-loading"))){
let meta = this.extractMeta(formEl, {}, opts.value)
Expand All @@ -1352,7 +1358,9 @@ export default class View {
value: formData,
meta: meta,
cid: cid
}).then(({resp}) => onReply(resp))
})
.then(({resp}) => onReply(resp))
.catch((error) => logError("Failed to push form submit", error))
}
}

Expand Down Expand Up @@ -1408,7 +1416,7 @@ export default class View {
}
uploader.initAdapterUpload(resp, onError, this.liveSocket)
}
})
}).catch((error) => logError("Failed to push upload", error))
})
}

Expand Down Expand Up @@ -1544,10 +1552,10 @@ export default class View {
if(completelyDestroyCIDs.length > 0){
this.pushWithReply(null, "cids_destroyed", {cids: completelyDestroyCIDs}).then(({resp}) => {
this.rendered.pruneCIDs(resp.cids)
})
}).catch((error) => logError("Failed to push components destroyed", error))
}
})
})
}).catch((error) => logError("Failed to push components destroyed", error))
}
}

Expand Down
Loading