diff --git a/ext_federation/src/client/federation_client.rs b/ext_federation/src/client/federation_client.rs index c5dba96..6f861da 100644 --- a/ext_federation/src/client/federation_client.rs +++ b/ext_federation/src/client/federation_client.rs @@ -1,14 +1,15 @@ use async_stream::stream; -use futures_util::{select, stream::StreamExt, FutureExt, Stream, TryStreamExt}; +use futures_util::{FutureExt, select, Stream, stream::StreamExt, TryStreamExt}; use headers::UserAgent; use hyper::body::Bytes; -use magnetar_core::web_model::ContentType; -use reqwest::{redirect::Policy, Client, RequestBuilder}; +use reqwest::{Client, redirect::Policy, RequestBuilder}; use serde_json::Value; use thiserror::Error; use tokio::pin; use url::Url; +use magnetar_core::web_model::ContentType; + #[derive(Debug, Clone)] pub struct FederationClient { pub client: Client, @@ -118,8 +119,10 @@ impl FederationRequestBuilder<'_> { async fn send_stream( self, - ) -> Result>, FederationClientError> + ) -> Result>, FederationClientError> { + eprintln!("{:?}", self.builder); + let mut body = self .builder .send() @@ -146,7 +149,7 @@ impl FederationRequestBuilder<'_> { let sleep = tokio::time::sleep(tokio::time::Duration::from_secs( self.client.timeout_seconds, )) - .fuse(); + .fuse(); tokio::pin!(sleep); let body = async move { @@ -158,7 +161,7 @@ impl FederationRequestBuilder<'_> { }) .await } - .fuse(); + .fuse(); pin!(body); diff --git a/fe_calckey/frontend/client/src/components/MagNoteResolvingProxy.vue b/fe_calckey/frontend/client/src/components/MagNoteResolvingProxy.vue index 07725d4..4c2abce 100644 --- a/fe_calckey/frontend/client/src/components/MagNoteResolvingProxy.vue +++ b/fe_calckey/frontend/client/src/components/MagNoteResolvingProxy.vue @@ -7,8 +7,9 @@ :pinned="pinned" > -
- +
+ + Fetching
@@ -39,6 +40,17 @@ watch( noteData.value = n; }); }, - { immediate: true }, + { immediate: true } ); + + diff --git a/fe_calckey/frontend/client/src/components/MagPoll.vue b/fe_calckey/frontend/client/src/components/MagPoll.vue index f619afc..388daac 100644 --- a/fe_calckey/frontend/client/src/components/MagPoll.vue +++ b/fe_calckey/frontend/client/src/components/MagPoll.vue @@ -47,10 +47,7 @@ {{ i18n.ts.reload }} - + · {{ i18n.ts._poll.voted }} · {{ i18n.ts._poll.closed }} @@ -77,31 +74,31 @@ const pollRefreshing = ref(false); const remaining = ref(-1); const total = computed(() => - sum(props.note.poll.options.map((x) => x.votes_count)), + sum(props.note.poll.options.map((x) => x.votes_count)) ); const closed = computed(() => remaining.value === 0); const isLocal = computed(() => !props.note.uri); const isVoted = computed( () => !props.note.poll.multiple_choice && - props.note.poll.options.some((c) => c.voted ?? false), + props.note.poll.options.some((c) => c.voted ?? false) ); const timer = computed(() => i18n.t( remaining.value >= 86400 ? "_poll.remainingDays" : remaining.value >= 3600 - ? "_poll.remainingHours" - : remaining.value >= 60 - ? "_poll.remainingMinutes" - : "_poll.remainingSeconds", + ? "_poll.remainingHours" + : remaining.value >= 60 + ? "_poll.remainingMinutes" + : "_poll.remainingSeconds", { s: Math.floor(remaining.value % 60), m: Math.floor(remaining.value / 60) % 60, h: Math.floor(remaining.value / 3600) % 24, d: Math.floor(remaining.value / 86400), - }, - ), + } + ) ); const showResult = ref(props.readOnly || isVoted.value); @@ -112,8 +109,8 @@ if (props.note.poll.expires_at) { remaining.value = Math.floor( Math.max( new Date(props.note.poll.expires_at!).getTime() - Date.now(), - 0, - ) / 1000, + 0 + ) / 1000 ); if (remaining.value === 0) { showResult.value = true; @@ -137,7 +134,7 @@ async function refresh() { os.magApi( endpoints.GetNoteById, { attachments: true }, - { id: obj.object.id }, + { id: obj.object.id } ).then((n) => { props.note.poll = { ...toRaw(props.note.poll), ...n.poll }; }); diff --git a/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue b/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue index de0cc03..bc9fd7f 100644 --- a/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue +++ b/fe_calckey/frontend/client/src/components/MkFollowApproveButton.vue @@ -1,6 +1,6 @@ + +
+ + + + @@ -277,16 +278,14 @@ :disabled="shouldDisableSubmitting" gradate data-cy-signup-submit - >{{ i18n.ts.start }} + >{{ i18n.ts.start }} + + + diff --git a/fe_calckey/frontend/client/src/components/global/MkLoading.vue b/fe_calckey/frontend/client/src/components/global/MkLoading.vue index 598405e..fd4f557 100644 --- a/fe_calckey/frontend/client/src/components/global/MkLoading.vue +++ b/fe_calckey/frontend/client/src/components/global/MkLoading.vue @@ -1,37 +1,50 @@ diff --git a/fe_calckey/frontend/client/src/init.ts b/fe_calckey/frontend/client/src/init.ts index 7d91f60..fda5476 100644 --- a/fe_calckey/frontend/client/src/init.ts +++ b/fe_calckey/frontend/client/src/init.ts @@ -60,12 +60,14 @@ import MkError from "./components/global/MkError.vue"; import MkPageHeader from "./components/global/MkPageHeader.vue"; import MkSpacer from "./components/global/MkSpacer.vue"; import MkStickyContainer from "./components/global/MkStickyContainer.vue"; +import MagSpinner from "@/components/global/MagSpinner.vue"; function globalComponents(app: App) { app.component("I18n", I18n); app.component("RouterView", RouterView); app.component("Mfm", Mfm); app.component("MkA", MkA); + app.component("MagSpinner", MagSpinner); app.component("MkAcct", MkAcct); app.component("MagAvatar", MagAvatar); app.component("MagEmoji", MagEmoji); @@ -87,6 +89,7 @@ declare module "@vue/runtime-core" { RouterView: typeof RouterView; Mfm: typeof Mfm; MkA: typeof MkA; + MagSpinner: typeof MagSpinner; MkAcct: typeof MkAcct; MagAvatar: typeof MagAvatar; MagEmoji: typeof MagEmoji; diff --git a/fe_calckey/frontend/client/src/ui/_common_/upload.vue b/fe_calckey/frontend/client/src/ui/_common_/upload.vue index 413e85f..6069e51 100644 --- a/fe_calckey/frontend/client/src/ui/_common_/upload.vue +++ b/fe_calckey/frontend/client/src/ui/_common_/upload.vue @@ -8,8 +8,7 @@ >

- {{ ctx.name }} + {{ ctx.name }}