mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-25 23:23:09 +02:00
5a3c6575dd
* feat: add defaultWithReplies to MiUser * feat: use defaultWithReplies when creating MiFollowing * feat: update defaultWithReplies from API * feat: return defaultWithReplies as a part of $i * feat(frontend): configure defaultWithReplies * docs(changelog): 新規にフォローした人のをデフォルトでTL二追加できるように * fix: typo * style: fix lint failure * chore: improve UI text * chore: make optional params of UserFollowingService.follow() object * chore: UserFollowingService.follow() accept withReplies * chore: add withReplies to MiFollowRequest * chore: process withReplies for follow request * feat: accept withReplies on 'following/create' endpoint * feat: store defaultWithReplies in client store * Revert "feat: return defaultWithReplies as a part of $i" This reverts commit f2cc4fe6 * Revert "feat: update defaultWithReplies from API" This reverts commit 95e3cee6 * Revert "feat: add defaultWithReplies to MiUser" This reverts commit 9f5ab14d7063532de2b049bc2ed40a15658168f5. * feat: configuring withReplies in import-following * feat(frontend): configure withReplies * fix(frontend): incorrectly showRepliesToOthersInTimeline can be shown * fix(backend): withReplies of following/create not working * fix(frontend): importFollowing error * fix: withReplies is not working with follow import * fix(frontend): use v-model * style: fix lint --------- Co-authored-by: Sayamame-beans <61457993+sayamame-beans@users.noreply.github.com> Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
70 lines
1.5 KiB
Vue
70 lines
1.5 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { } from 'vue';
|
|
import * as Misskey from 'misskey-js';
|
|
import * as os from '@/os.js';
|
|
import { mainRouter } from '@/router.js';
|
|
import { i18n } from '@/i18n.js';
|
|
import { defaultStore } from "@/store.js";
|
|
|
|
async function follow(user): Promise<void> {
|
|
const { canceled } = await os.confirm({
|
|
type: 'question',
|
|
text: i18n.t('followConfirm', { name: user.name || user.username }),
|
|
});
|
|
|
|
if (canceled) {
|
|
window.close();
|
|
return;
|
|
}
|
|
|
|
os.apiWithDialog('following/create', {
|
|
userId: user.id,
|
|
withReplies: defaultStore.state.defaultWithReplies,
|
|
});
|
|
user.withReplies = defaultStore.state.defaultWithReplies;
|
|
}
|
|
|
|
const acct = new URL(location.href).searchParams.get('acct');
|
|
if (acct == null) {
|
|
throw new Error('acct required');
|
|
}
|
|
|
|
let promise;
|
|
|
|
if (acct.startsWith('https://')) {
|
|
promise = os.api('ap/show', {
|
|
uri: acct,
|
|
});
|
|
promise.then(res => {
|
|
if (res.type === 'User') {
|
|
follow(res.object);
|
|
} else if (res.type === 'Note') {
|
|
mainRouter.push(`/notes/${res.object.id}`);
|
|
} else {
|
|
os.alert({
|
|
type: 'error',
|
|
text: 'Not a user',
|
|
}).then(() => {
|
|
window.close();
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
promise = os.api('users/show', Misskey.acct.parse(acct));
|
|
promise.then(user => {
|
|
follow(user);
|
|
});
|
|
}
|
|
|
|
os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);
|
|
</script>
|