enhance: 非ログイン時には別サーバーに遷移できるように (#13089)

* enhance: 非ログイン時にはMisskey Hub経由で別サーバーに遷移できるように

* fix

* サーバーサイド照会を削除

* クライアント側の照会動作

* hubを経由せずにリモートで続行できるように

* fix と pleaseLogin誘導箇所の追加

* fix

* fix

* Update CHANGELOG.md

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2024-07-14 15:27:52 +09:00
committed by GitHub
parent 6dd6fcf88f
commit 3c032dd5b9
19 changed files with 330 additions and 113 deletions

View File

@@ -34,6 +34,7 @@ import { pleaseLogin } from '@/scripts/please-login.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { host } from '@/config.js';
import { useInterval } from '@/scripts/use-interval.js';
const props = defineProps<{
@@ -60,6 +61,11 @@ const timer = computed(() => i18n.tsx._poll[
const showResult = ref(props.readOnly || isVoted.value);
const pleaseLoginContext = {
type: 'lookup',
path: `https://${host}/notes/${props.note.id}`,
} as const;
// 期限付きアンケート
if (props.poll.expiresAt) {
const tick = () => {
@@ -76,7 +82,7 @@ if (props.poll.expiresAt) {
}
const vote = async (id) => {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
if (props.readOnly || closed.value || isVoted.value) return;