User and note fetching fixes
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
This commit is contained in:
parent
69cb1c5220
commit
05469f68a8
|
@ -359,17 +359,17 @@ impl NoteResolver {
|
|||
let mut select = note::Entity::find().add_aliased_columns(Some(USER), user::Entity);
|
||||
|
||||
if let Some(pins_user) = options.only_pins_from.clone() {
|
||||
select = select.join_as(
|
||||
JoinType::InnerJoin,
|
||||
note::Relation::UserNotePining
|
||||
.def()
|
||||
.on_condition(move |left, _right| {
|
||||
Expr::col((left, note::Column::UserId))
|
||||
.eq(&pins_user)
|
||||
.into_condition()
|
||||
}),
|
||||
ALIAS_PIN.clone(),
|
||||
)
|
||||
select = select
|
||||
.join_as(
|
||||
JoinType::InnerJoin,
|
||||
note::Relation::UserNotePining.def(),
|
||||
ALIAS_PIN.clone(),
|
||||
)
|
||||
.filter(
|
||||
Expr::col((ALIAS_PIN.clone(), user_note_pining::Column::UserId))
|
||||
.eq(&pins_user)
|
||||
.into_condition(),
|
||||
)
|
||||
}
|
||||
|
||||
if let Some(user_id) = &options.with_interactions_from {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { host as localHost } from "@/config";
|
||||
import { computed, defineAsyncComponent, watch } from "vue";
|
||||
import * as os from "@/os";
|
||||
import { useRouter } from "@/router";
|
||||
|
@ -60,9 +61,10 @@ let tab = $ref(props.page);
|
|||
let user = $ref<null | packed.PackUserSelfMaybeAll>(null);
|
||||
let error = $ref<any>(null);
|
||||
|
||||
function fetchUser(refetch: boolean = true): void {
|
||||
function fetchUser(refetch: boolean = true, clear: boolean = true): void {
|
||||
if (!props.acct) return;
|
||||
user = null;
|
||||
|
||||
if (clear) user = null;
|
||||
|
||||
os.magApi(
|
||||
endpoints.GetUserByAcct,
|
||||
|
@ -78,11 +80,13 @@ function fetchUser(refetch: boolean = true): void {
|
|||
new Date().getTime() -
|
||||
new Date(user.last_fetched_at).getTime() >
|
||||
dayMs) &&
|
||||
user.host !== null &&
|
||||
user.host !== localHost &&
|
||||
refetch
|
||||
) {
|
||||
os.api("users/show", Acct.parse(props.acct))
|
||||
.then(() => {
|
||||
fetchUser(false);
|
||||
fetchUser(false, false);
|
||||
})
|
||||
.catch((e) => {
|
||||
error = e;
|
||||
|
|
|
@ -68,7 +68,7 @@ fn split_tag_inner(tag: impl AsRef<str>) -> (String, Option<String>) {
|
|||
fn validate_tag_inner((name, host): (&str, Option<&str>)) -> Result<(), FediverseTagParseError> {
|
||||
if name
|
||||
.chars()
|
||||
.any(|c| !c.is_alphanumeric() && c != '-' && c != '.')
|
||||
.any(|c| !c.is_alphanumeric() && c != '-' && c != '_' && c != '.')
|
||||
{
|
||||
return Err(FediverseTagParseError::InvalidChar(name.to_owned()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue