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

pull/818/head
Piotrek Tomczewski 2023-01-07 08:55:07 +01:00 zatwierdzone przez GitHub
rodzic 6a78f9c9e3
commit 2ff46bb8cb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

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

Wyświetl plik

@ -49,6 +49,11 @@ const focusEditor = () => {
provide('focus-editor', focusEditor)
watch(publishWidget, () => {
if (window.history.state.focusReply)
focusEditor()
})
onReactivated(() => {
// 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