client: show remote interaction dialog for follow button

Changelog: Fixed
This commit is contained in:
Johann150 2023-03-05 23:39:43 +01:00
parent 57241cdffe
commit fbfbe4a72e
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 9 additions and 0 deletions

View file

@ -26,6 +26,7 @@ import * as foundkey from 'foundkey-js';
import * as os from '@/os'; import * as os from '@/os';
import { stream } from '@/stream'; import { stream } from '@/stream';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { pleaseLoginOrRemote, urlForUser } from '@/scripts/please-login';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
user: foundkey.entities.UserDetailed, user: foundkey.entities.UserDetailed,
@ -59,6 +60,8 @@ async function onClick() {
wait = true; wait = true;
try { try {
pleaseLoginOrRemote(urlForUser(props.user));
if (isFollowing) { if (isFollowing) {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'warning', type: 'warning',

View file

@ -37,3 +37,9 @@ export function urlForNote(note: entities.Note): string {
?? note.uri ?? note.uri
?? `${url}/notes/${note.id}`; ?? `${url}/notes/${note.id}`;
} }
export function urlForUser(user: entities.User): string {
return user.url
?? user.uri
?? `${url}/users/${user.id}`;
}