client: show remote interaction dialog for follow button
Changelog: Fixed
This commit is contained in:
parent
57241cdffe
commit
fbfbe4a72e
2 changed files with 9 additions and 0 deletions
|
@ -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',
|
||||||
|
|
|
@ -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}`;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue