From fbfbe4a72ee0ca85577d460dcb6ae31d0295ab74 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 5 Mar 2023 23:39:43 +0100 Subject: [PATCH] client: show remote interaction dialog for follow button Changelog: Fixed --- packages/client/src/components/follow-button.vue | 3 +++ packages/client/src/scripts/please-login.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/packages/client/src/components/follow-button.vue b/packages/client/src/components/follow-button.vue index 938e73e27..e8bb264c6 100644 --- a/packages/client/src/components/follow-button.vue +++ b/packages/client/src/components/follow-button.vue @@ -26,6 +26,7 @@ import * as foundkey from 'foundkey-js'; import * as os from '@/os'; import { stream } from '@/stream'; import { i18n } from '@/i18n'; +import { pleaseLoginOrRemote, urlForUser } from '@/scripts/please-login'; const props = withDefaults(defineProps<{ user: foundkey.entities.UserDetailed, @@ -59,6 +60,8 @@ async function onClick() { wait = true; try { + pleaseLoginOrRemote(urlForUser(props.user)); + if (isFollowing) { const { canceled } = await os.confirm({ type: 'warning', diff --git a/packages/client/src/scripts/please-login.ts b/packages/client/src/scripts/please-login.ts index 597f32e16..d31aea40b 100644 --- a/packages/client/src/scripts/please-login.ts +++ b/packages/client/src/scripts/please-login.ts @@ -37,3 +37,9 @@ export function urlForNote(note: entities.Note): string { ?? note.uri ?? `${url}/notes/${note.id}`; } + +export function urlForUser(user: entities.User): string { + return user.url + ?? user.uri + ?? `${url}/users/${user.id}`; +}