fix(onboarding): redirecting to tutorial even if completed tutorial
This commit is contained in:
parent
f0981cb762
commit
a92858944d
2 changed files with 9 additions and 2 deletions
|
@ -15,6 +15,7 @@ import { updateI18n } from '@/i18n.js';
|
|||
import { $i, iAmAdmin, refreshAccount, login } from '@/account.js';
|
||||
import { defaultStore, ColdDeviceStorage } from '@/store.js';
|
||||
import { fetchInstance, instance } from '@/instance.js';
|
||||
import { claimedAchievements } from '@/scripts/achievements.js';
|
||||
import { deviceKind } from '@/scripts/device-kind.js';
|
||||
import { reloadChannel } from '@/scripts/unison-reload.js';
|
||||
import { getUrlWithoutLoginId } from '@/scripts/login-id.js';
|
||||
|
@ -119,7 +120,13 @@ export async function common(createVue: () => App<Element>) {
|
|||
await deckStore.ready;
|
||||
|
||||
// 2024年4月1日JST以降に作成されたアカウントで、チュートリアルを完了していない通常ユーザーの場合、チュートリアルにリダイレクト
|
||||
if (!instance.canSkipInitialTutorial && $i && !iAmAdmin && defaultStore.state.accountSetupWizard !== -1 && !location.pathname.startsWith('/onboarding') && !location.pathname.startsWith('/signup-complete')) {
|
||||
if (
|
||||
!instance.canSkipInitialTutorial &&
|
||||
$i && !iAmAdmin &&
|
||||
!claimedAchievements.includes('tutorialCompleted') &&
|
||||
!location.pathname.startsWith('/onboarding') &&
|
||||
!location.pathname.startsWith('/signup-complete')
|
||||
) {
|
||||
const param = new URLSearchParams();
|
||||
param.set('redirected_from', location.pathname + location.search + location.hash);
|
||||
location.replace('/onboarding?' + param.toString());
|
||||
|
|
|
@ -64,7 +64,7 @@ export const pageViewInterruptors: PageViewInterruptor[] = [];
|
|||
// あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない
|
||||
export const defaultStore = markRaw(new Storage('base', {
|
||||
accountSetupWizard: {
|
||||
where: 'account',
|
||||
where: 'deviceAccount',
|
||||
default: 0,
|
||||
},
|
||||
timelineTutorials: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue