feat(ui): opening the details page with the reply button (#840)

zio/stable
Piotrek Tomczewski 2023-01-07 08:55:07 +01:00 committed by GitHub
parent 6a78f9c9e3
commit 2ff46bb8cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -24,13 +24,11 @@ const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumbe
const reply = () => { const reply = () => {
if (!checkLogin()) if (!checkLogin())
return return
if (details) { if (details)
focusEditor() focusEditor()
}
else { else
const { key, draft } = getReplyDraft(status) navigateTo({ path: getStatusRoute(status).href, state: { focusReply: true } })
openPublishDialog(key, draft())
}
} }
</script> </script>

View File

@ -49,6 +49,11 @@ const focusEditor = () => {
provide('focus-editor', focusEditor) provide('focus-editor', focusEditor)
watch(publishWidget, () => {
if (window.history.state.focusReply)
focusEditor()
})
onReactivated(() => { onReactivated(() => {
// Silently update data when reentering the page // Silently update data when reentering the page
// The user will see the previous content first, and any changes will be updated to the UI when the request is completed // The user will see the previous content first, and any changes will be updated to the UI when the request is completed