mirror of
https://git.notfire.cc/notfire/akkoma-fe.git
synced 2026-01-11 05:23:16 -08:00
add option to prevent page from getting pushed when making a new post with streaming api enabled
This commit is contained in:
parent
872c110510
commit
526f7464d1
6 changed files with 23 additions and 0 deletions
|
|
@ -34,6 +34,7 @@
|
|||
- script to get new emojis is included for future unicode versions
|
||||
- add toggle for showing post edit notifications
|
||||
- add support for accepted follow request notifications
|
||||
- add option to prevent page from getting pushed when making a new post with streaming api enabled (similar to 3rd "for unreads" option)
|
||||
- add a script to download ruffle for flash support (requires python3 and requests library)
|
||||
- download by entering `tools/` and running `python3 download_ruffle.py`
|
||||
|
||||
|
|
|
|||
|
|
@ -436,6 +436,8 @@ const PostStatusForm = {
|
|||
|
||||
const postHandler = this.postHandler ? this.postHandler : statusPoster.postStatus
|
||||
|
||||
let bef = document.getElementsByClassName("Timeline")[0].scrollHeight
|
||||
|
||||
postHandler(postingOptions).then((data) => {
|
||||
if (!data.error) {
|
||||
this.clearStatus()
|
||||
|
|
@ -444,6 +446,14 @@ const PostStatusForm = {
|
|||
this.error = data.error
|
||||
}
|
||||
this.posting = false
|
||||
|
||||
// same as timeline.js
|
||||
if (this.$store.getters.mergedConfig.fixupScrollOnPostWStreaming && window.scrollY > 0) {
|
||||
let after = document.getElementsByClassName("Timeline")[0].scrollHeight
|
||||
let diff = bef - after
|
||||
if (diff < 0) diff = diff * -1
|
||||
window.scrollTo({ top: (window.scrollY + diff) })
|
||||
}
|
||||
})
|
||||
},
|
||||
previewStatus () {
|
||||
|
|
|
|||
|
|
@ -229,6 +229,15 @@
|
|||
{{ $t('settings.deletePostsStreaming') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting
|
||||
path="fixupScrollOnPostWStreaming"
|
||||
:disabled="!useStreamingApi"
|
||||
expert="1"
|
||||
>
|
||||
{{ $t('settings.fixup_scroll_on_post_with_streaming') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -577,6 +577,7 @@
|
|||
},
|
||||
"filtering": "Filtering",
|
||||
"filtering_explanation": "All posts containing these words will be muted, one per line",
|
||||
"fixup_scroll_on_post_with_streaming": "Prevent the page from getting pushed down by new posts you make",
|
||||
"follow_export": "Follow export",
|
||||
"follow_export_button": "Export your follows to a csv file",
|
||||
"follow_import": "Follow import",
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ export const defaultState = {
|
|||
recurseSearchLimit: 100,
|
||||
dedupeBoosts: true,
|
||||
scrollToTopOnNewPostClick: true,
|
||||
fixupScrollOnPostWStreaming: false,
|
||||
showFaviconBadge: true,
|
||||
autoRefreshOnRequired: true,
|
||||
showUnreadInTitle: true,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ const defaultState = {
|
|||
recurseSearchLimit: 100,
|
||||
dedupeBoosts: true,
|
||||
scrollToTopOnNewPostClick: true,
|
||||
fixupScrollOnPostWStreaming: false,
|
||||
showFaviconBadge: true,
|
||||
autoRefreshOnRequired: true,
|
||||
showUnreadInTitle: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue