実績を凍結する
This commit is contained in:
parent
2f3c2af619
commit
23670ff0fe
10 changed files with 38 additions and 15 deletions
|
|
@ -162,6 +162,7 @@ import { claimAchievement } from '@/scripts/achievements';
|
|||
import { getNoteSummary } from '@/scripts/get-note-summary';
|
||||
import { MenuItem } from '@/types/menu';
|
||||
import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
||||
import { showMovedDialog } from '@/scripts/show-moved-dialog';
|
||||
|
||||
const props = defineProps<{
|
||||
note: misskey.entities.Note;
|
||||
|
|
@ -255,6 +256,7 @@ useTooltip(renoteButton, async (showing) => {
|
|||
|
||||
function renote(viaKeyboard = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
let items = [] as MenuItem[];
|
||||
|
||||
|
|
@ -335,6 +337,7 @@ function reply(viaKeyboard = false): void {
|
|||
|
||||
function react(viaKeyboard = false): void {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||
os.api('notes/reactions/create', {
|
||||
noteId: appearNote.id,
|
||||
|
|
@ -401,6 +404,7 @@ async function clip() {
|
|||
|
||||
function showRenoteMenu(viaKeyboard = false): void {
|
||||
if (!isMyRenote) return;
|
||||
pleaseLogin();
|
||||
os.popupMenu([{
|
||||
text: i18n.ts.unrenote,
|
||||
icon: 'ti ti-trash',
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ import { useTooltip } from '@/scripts/use-tooltip';
|
|||
import { claimAchievement } from '@/scripts/achievements';
|
||||
import { MenuItem } from '@/types/menu';
|
||||
import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
||||
import { showMovedDialog } from '@/scripts/show-moved-dialog';
|
||||
|
||||
const props = defineProps<{
|
||||
note: misskey.entities.Note;
|
||||
|
|
@ -248,6 +249,7 @@ useTooltip(renoteButton, async (showing) => {
|
|||
|
||||
function renote(viaKeyboard = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
let items = [] as MenuItem[];
|
||||
|
||||
|
|
@ -318,6 +320,7 @@ function renote(viaKeyboard = false) {
|
|||
|
||||
function reply(viaKeyboard = false): void {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
os.post({
|
||||
reply: appearNote,
|
||||
animation: !viaKeyboard,
|
||||
|
|
@ -328,6 +331,7 @@ function reply(viaKeyboard = false): void {
|
|||
|
||||
function react(viaKeyboard = false): void {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||
os.api('notes/reactions/create', {
|
||||
noteId: appearNote.id,
|
||||
|
|
@ -394,6 +398,7 @@ async function clip() {
|
|||
|
||||
function showRenoteMenu(viaKeyboard = false): void {
|
||||
if (!isMyRenote) return;
|
||||
pleaseLogin();
|
||||
os.popupMenu([{
|
||||
text: i18n.ts.unrenote,
|
||||
icon: 'ti ti-trash',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import MkPopupMenu from '@/components/MkPopupMenu.vue';
|
|||
import MkContextMenu from '@/components/MkContextMenu.vue';
|
||||
import { MenuItem } from '@/types/menu';
|
||||
import copyToClipboard from './scripts/copy-to-clipboard';
|
||||
import { $i } from './account';
|
||||
import { showMovedDialog } from './scripts/show-moved-dialog';
|
||||
|
||||
export const openingWindowsCount = ref(0);
|
||||
|
||||
|
|
@ -579,13 +579,7 @@ export function contextMenu(items: MenuItem[] | Ref<MenuItem[]>, ev: MouseEvent)
|
|||
}
|
||||
|
||||
export function post(props: Record<string, any> = {}): Promise<void> {
|
||||
if ($i && $i.movedTo) {
|
||||
return alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.accountMovedShort,
|
||||
text: i18n.ts.operationForbidden,
|
||||
});
|
||||
}
|
||||
showMovedDialog();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// NOTE: MkPostFormDialogをdynamic importするとiOSでテキストエリアに自動フォーカスできない
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<MkButton primary :class="$style.button" inline @click="exportFollowing()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<MkFolder v-if="$i && !$i.movedTo">
|
||||
<template #label>{{ i18n.ts.import }}</template>
|
||||
<template #icon><i class="ti ti-upload"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="importFollowing($event)"><i class="ti ti-upload"></i> {{ i18n.ts.import }}</MkButton>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<template #icon><i class="ti ti-download"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="exportUserLists()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<MkFolder v-if="$i && !$i.movedTo">
|
||||
<template #label>{{ i18n.ts.import }}</template>
|
||||
<template #icon><i class="ti ti-upload"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="importUserLists($event)"><i class="ti ti-upload"></i> {{ i18n.ts.import }}</MkButton>
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
<template #icon><i class="ti ti-download"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="exportMuting()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<MkFolder v-if="$i && !$i.movedTo">
|
||||
<template #label>{{ i18n.ts.import }}</template>
|
||||
<template #icon><i class="ti ti-upload"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="importMuting($event)"><i class="ti ti-upload"></i> {{ i18n.ts.import }}</MkButton>
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<template #icon><i class="ti ti-download"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="exportBlocking()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<MkFolder v-if="$i && !$i.movedTo">
|
||||
<template #label>{{ i18n.ts.import }}</template>
|
||||
<template #icon><i class="ti ti-upload"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="importBlocking($event)"><i class="ti ti-upload"></i> {{ i18n.ts.import }}</MkButton>
|
||||
|
|
@ -97,6 +97,7 @@ import * as os from '@/os';
|
|||
import { selectFile } from '@/scripts/select-file';
|
||||
import { i18n } from '@/i18n';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { $i } from '@/account';
|
||||
|
||||
const excludeMutingUsers = ref(false);
|
||||
const excludeInactiveUsers = ref(false);
|
||||
|
|
|
|||
|
|
@ -464,6 +464,7 @@ const claimingQueue = new Set<string>();
|
|||
|
||||
export async function claimAchievement(type: typeof ACHIEVEMENT_TYPES[number]) {
|
||||
if ($i == null) return;
|
||||
if ($i.movedTo) return;
|
||||
if (claimedAchievements.includes(type)) return;
|
||||
claimingQueue.add(type);
|
||||
claimedAchievements.push(type);
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ export function pleaseLogin(path?: string) {
|
|||
},
|
||||
}, 'closed');
|
||||
|
||||
if (!path) throw new Error('signin required');
|
||||
throw new Error('signin required');
|
||||
}
|
||||
|
|
|
|||
16
packages/frontend/src/scripts/show-moved-dialog.ts
Normal file
16
packages/frontend/src/scripts/show-moved-dialog.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import * as os from '@/os';
|
||||
import { $i } from '@/account';
|
||||
import { i18n } from '@/i18n';
|
||||
|
||||
export function showMovedDialog() {
|
||||
if (!$i) return;
|
||||
if (!$i.movedTo) return;
|
||||
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.accountMovedShort,
|
||||
text: i18n.ts.operationForbidden,
|
||||
});
|
||||
|
||||
throw new Error('account moved');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue