summaryrefslogtreecommitdiff
path: root/packages/frontend/src/tips.ts
blob: d5fc047c2beb8d79c95926afb0793a99ed23a1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

import { store } from '@/store.js';

export const TIPS = [
	'drive',
	'uploader',
	'postFormUploader',
	'clips',
	'userLists',
	'postForm',
	'deck',
	'tl.home',
	'tl.local',
	'tl.social',
	'tl.global',
	'abuses',
] as const;

export function closeTip(tip: typeof TIPS[number]) {
	store.set('tips', {
		...store.r.tips.value,
		[tip]: true,
	});
}

export function resetAllTips() {
	store.set('tips', {});
}

export function hideAllTips() {
	const v = {} as Record<typeof TIPS[number], boolean>;
	for (const k of TIPS) {
		v[k] = true;
	}
	store.set('tips', v);
}