diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index 977e1fb02..23d906a6e 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -18,44 +18,48 @@
-
- - {{ i18n.ts.loadMore }} - - -
- -
- - {{ i18n.ts.loadMore }} - - -
+ + {{ i18n.ts.loadMore }} + + +
+ +
+
+ + {{ i18n.ts.loadMore }} + + +
+
@@ -84,6 +88,7 @@ import MkButton from "@/components/MkButton.vue"; import { i18n } from "@/i18n"; import {instance} from "@/instance"; import { defaultStore } from "@/store.js"; +import MkPullToRefresh from "@/components/MkPullToRefresh.vue"; export type Paging< E extends keyof misskey.Endpoints = keyof misskey.Endpoints, @@ -201,7 +206,12 @@ const reload = (): void => { init(); }; -const refresh = async (): void => { +const reloadAsync = (): Promise => { + items.value = []; + return init(); +}; + +const refresh = async (): Promise => { const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value @@ -503,6 +513,7 @@ defineExpose({ removeItem, updateItem, prefetchMore, + reloadAsync, }); diff --git a/packages/client/src/components/MkPullToRefresh.vue b/packages/client/src/components/MkPullToRefresh.vue new file mode 100644 index 000000000..27f72fc19 --- /dev/null +++ b/packages/client/src/components/MkPullToRefresh.vue @@ -0,0 +1,229 @@ + + + + + + + diff --git a/packages/client/src/style.scss b/packages/client/src/style.scss index 3ffef9cca..19d6c040c 100644 --- a/packages/client/src/style.scss +++ b/packages/client/src/style.scss @@ -46,7 +46,7 @@ html { tab-size: 2; scroll-padding: 60px; overflow-x: clip; - overscroll-behavior-y: none; + overscroll-behavior: none; &.useCJKFont { font-family: "Hiragino Maru Gothic Pro", "BIZ UDGothic", Roboto,