Merge pull request #3550 from h3poteto/iss-3300/reload

refs #3300 Enable shortcut to reload timeline
This commit is contained in:
AkiraFukushima 2022-08-12 22:52:36 +09:00 committed by GitHub
commit 2ece311f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 40 additions and 10 deletions

View File

@ -53,7 +53,7 @@ export default defineComponent({
const focusedId = ref<string | null>(null)
const heading = ref<boolean>(true)
const scroller = ref<any>()
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const bookmarks = computed(() => store.state.TimelineSpace.Contents.Bookmarks.bookmarks)
const lazyLoading = computed(() => store.state.TimelineSpace.Contents.Bookmarks.lazyLoading)
@ -97,6 +97,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const onScroll = (event: Event) => {
if (

View File

@ -55,7 +55,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -143,6 +143,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const initialize = async () => {
await store.dispatch(`${space}/${ACTION_TYPES.FETCH_TIMELINE}`).catch(_ => {

View File

@ -51,7 +51,7 @@ export default defineComponent({
const heading = ref<boolean>(false)
const focusedId = ref<string | null>(null)
const scroller = ref<any>()
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const openSideBar = computed(() => store.state.TimelineSpace.Contents.SideBar.openSideBar)
const startReload = computed(() => store.state.TimelineSpace.HeaderMenu.reload)
@ -105,6 +105,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const onScroll = (event: Event) => {
if (

View File

@ -55,7 +55,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const { tag } = toRefs(props)
const focusedId = ref<string | null>(null)
@ -134,6 +134,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
onBeforeUnmount(() => {
store.dispatch(`${space}/${ACTION_TYPES.STOP_STREAMING}`)

View File

@ -63,7 +63,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -175,6 +175,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const onScroll = (event: Event) => {
if (moment().diff(resizeTime.value) < 500) {

View File

@ -51,7 +51,7 @@ export default defineComponent({
const space = 'TimelineSpace/Contents/Lists/Show'
const store = useStore()
const i18n = useI18next()
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const { list_id } = toRefs(props)
const focusedId = ref<string | null>(null)
@ -129,6 +129,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
onBeforeUnmount(() => {
store.dispatch(`${space}/${ACTION_TYPES.STOP_STREAMING}`)

View File

@ -55,7 +55,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -154,6 +154,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const initialize = async () => {
await store.dispatch(`${space}/${ACTION_TYPES.FETCH_LOCAL_TIMELINE}`).catch(_ => {

View File

@ -62,7 +62,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -156,6 +156,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const onScroll = (event: Event) => {
if (moment().diff(resizeTime.value) < 500) {

View File

@ -61,7 +61,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -161,6 +161,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const onScroll = (event: Event) => {
if (moment().diff(resizeTime.value) < 500) {

View File

@ -55,7 +55,7 @@ export default defineComponent({
const route = useRoute()
const i18n = useI18next()
const { reloadable } = useReloadable(store, route, i18n)
const { j, k } = useMagicKeys()
const { j, k, r } = useMagicKeys()
const focusedId = ref<string | null>(null)
const scrollPosition = ref<ScrollPosition | null>(null)
@ -155,6 +155,9 @@ export default defineComponent({
whenever(and(k, shortcutEnabled), () => {
focusPrev()
})
whenever(and(r, shortcutEnabled), () => {
reload()
})
const initialize = async () => {
await store.dispatch(`${space}/${ACTION_TYPES.FETCH_PUBLIC_TIMELINE}`).catch(_ => {