新しい実績を追加 (#11817)
* (add) new achievement * (update) changelog * Update test-notification.ts * tweak --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
42c7aad251
commit
3456680e1d
8 changed files with 51 additions and 39 deletions
|
@ -96,7 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<option value="horizontal"><i class="ti ti-carousel-horizontal"></i> {{ i18n.ts.horizontal }}</option>
|
||||
</MkRadios>
|
||||
|
||||
<MkButton @click="testNotification('client')">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton>
|
||||
<MkButton @click="testNotification">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
|
@ -176,6 +176,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
|
@ -192,7 +193,8 @@ import { unisonReload } from '@/scripts/unison-reload';
|
|||
import { i18n } from '@/i18n';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { miLocalStorage } from '@/local-storage';
|
||||
import { testNotification } from '@/scripts/test-notification';
|
||||
import { globalEvents } from '@/events';
|
||||
import { claimAchievement } from '@/scripts/achievements';
|
||||
|
||||
const lang = ref(miLocalStorage.getItem('lang'));
|
||||
const fontSize = ref(miLocalStorage.getItem('fontSize'));
|
||||
|
@ -305,6 +307,32 @@ function removeEmojiIndex(lang: string) {
|
|||
os.promiseDialog(main());
|
||||
}
|
||||
|
||||
let smashCount = 0;
|
||||
let smashTimer: number | null = null;
|
||||
function testNotification(): void {
|
||||
const notification: Misskey.entities.Notification = {
|
||||
id: Math.random().toString(),
|
||||
createdAt: new Date().toUTCString(),
|
||||
isRead: false,
|
||||
type: 'test',
|
||||
};
|
||||
|
||||
globalEvents.emit('clientNotification', notification);
|
||||
|
||||
// セルフ通知破壊 実績関連
|
||||
smashCount++;
|
||||
if (smashCount >= 10) {
|
||||
claimAchievement('smashTestNotificationButton');
|
||||
smashCount = 0;
|
||||
}
|
||||
if (smashTimer) {
|
||||
clearTimeout(smashTimer);
|
||||
}
|
||||
smashTimer = window.setTimeout(() => {
|
||||
smashCount = 0;
|
||||
}, 300);
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue