summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-21 12:49:29 +0900
committerGitHub <noreply@github.com>2024-10-21 12:49:29 +0900
commit5c79d8db208da1fd7c5bc4900090c3d7b9512196 (patch)
tree0be695300f396721e472543052d6fcdfb8a2e636 /packages/frontend/src/scripts
parentfix(frontend): Captcha のエラーハンドリング (#14811) (diff)
downloadsharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.tar.gz
sharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.tar.bz2
sharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.zip
feat: ノートの閲覧にログイン必須にする設定 (#14799)
* wip * wip * wip * Update packages/frontend/src/pages/note.vue Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> * wip * Update WebhookTestService.ts * Update privacy.vue * wip * rename * Update locales/ja-JP.yml Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> * :art: * wip --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/please-login.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/frontend/src/scripts/please-login.ts b/packages/frontend/src/scripts/please-login.ts
index 18f05bc7f4..43dcf11936 100644
--- a/packages/frontend/src/scripts/please-login.ts
+++ b/packages/frontend/src/scripts/please-login.ts
@@ -44,17 +44,21 @@ export type OpenOnRemoteOptions = {
params: Record<string, string>;
};
-export function pleaseLogin(path?: string, openOnRemote?: OpenOnRemoteOptions) {
+export function pleaseLogin(opts: {
+ path?: string;
+ message?: string;
+ openOnRemote?: OpenOnRemoteOptions;
+} = {}) {
if ($i) return;
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
autoSet: true,
- message: openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired,
- openOnRemote,
+ message: opts.message ?? (opts.openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired),
+ openOnRemote: opts.openOnRemote,
}, {
cancelled: () => {
- if (path) {
- window.location.href = path;
+ if (opts.path) {
+ window.location.href = opts.path;
}
},
closed: () => dispose(),