チュートリアル完了後にアカウントのキャッシュが更新されない問題を修正
This commit is contained in:
parent
79812e4ccb
commit
63b7795007
|
@ -129,10 +129,14 @@ export async function common(createVue: () => App<Element>) {
|
|||
!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());
|
||||
return;
|
||||
await refreshAccount();
|
||||
|
||||
if ($i && !$i.achievements.map((v) => v.name).includes('tutorialCompleted')) {
|
||||
const param = new URLSearchParams();
|
||||
param.set('redirected_from', location.pathname + location.search + location.hash);
|
||||
location.replace('/onboarding?' + param.toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const fetchInstanceMetaPromise = fetchInstance();
|
||||
|
|
|
@ -39,7 +39,7 @@ import FormSlot from '@/components/form/slot.vue';
|
|||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import { selectFile } from '@/scripts/select-file.js';
|
||||
import * as os from '@/os.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { signinRequired, updateAccount } from '@/account.js';
|
||||
import type { TutorialPageCommonExpose } from '@/components/MkTutorial.vue';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
@ -53,6 +53,7 @@ watch(name, () => {
|
|||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
name: name.value || null,
|
||||
});
|
||||
updateAccount({ name: name.value });
|
||||
});
|
||||
|
||||
watch(description, () => {
|
||||
|
@ -61,6 +62,7 @@ watch(description, () => {
|
|||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
description: description.value || null,
|
||||
});
|
||||
updateAccount({ description: description.value });
|
||||
});
|
||||
|
||||
function setAvatar(ev: MouseEvent) {
|
||||
|
@ -83,8 +85,7 @@ function setAvatar(ev: MouseEvent) {
|
|||
const i = await os.apiWithDialog('i/update', {
|
||||
avatarId: originalOrCropped.id,
|
||||
});
|
||||
$i.avatarId = i.avatarId;
|
||||
$i.avatarUrl = i.avatarUrl;
|
||||
updateAccount({ avatarId: i.avatarId, avatarUrl: i.avatarUrl });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { $i, refreshAccount } from '@/account.js';
|
||||
|
||||
export const ACHIEVEMENT_TYPES = [
|
||||
'notes1',
|
||||
|
@ -500,6 +500,10 @@ export async function claimAchievement(type: typeof ACHIEVEMENT_TYPES[number]) {
|
|||
await new Promise(resolve => setTimeout(resolve, (claimingQueue.size - 1) * 500));
|
||||
window.setTimeout(() => {
|
||||
claimingQueue.delete(type);
|
||||
|
||||
if (claimingQueue.size === 0) {
|
||||
refreshAccount();
|
||||
}
|
||||
}, 500);
|
||||
misskeyApi('i/claim-achievement', { name: type });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue