mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-16 20:29:02 +01:00
commit
7c9330a02f
18 changed files with 65 additions and 55 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -9,6 +9,18 @@
|
||||||
You should also include the user name that made the change.
|
You should also include the user name that made the change.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 13.7.3 (2023/02/23)
|
||||||
|
|
||||||
|
### Note
|
||||||
|
13.7.0以前から直接このバージョンにアップデートする場合は全ての通知が削除**されません。**
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
- Client: 「キャッシュを削除」した後、ローカルのカスタム絵文字が表示されなくなるされなくなる問題を修正
|
||||||
|
- Client: 通知設定画面で以前からグループの招待を有効化していた場合、通知の表示に失敗する問題の修正
|
||||||
|
- Client: 通知設定画面に古いトグルが残っていた問題を修正
|
||||||
|
|
||||||
## 13.7.2 (2023/02/23)
|
## 13.7.2 (2023/02/23)
|
||||||
|
|
||||||
### Note
|
### Note
|
||||||
|
|
|
@ -83,7 +83,7 @@ An actual domain will be assigned so you can test the federation.
|
||||||
- The title must be in the format `Release: x.y.z`.
|
- The title must be in the format `Release: x.y.z`.
|
||||||
- `x.y.z` is the new version you are trying to release.
|
- `x.y.z` is the new version you are trying to release.
|
||||||
3. Deploy and perform a simple QA check. Also verify that the tests passed.
|
3. Deploy and perform a simple QA check. Also verify that the tests passed.
|
||||||
4. Merge it.
|
4. Merge it. (Do not squash commit)
|
||||||
5. Create a [release of GitHub](https://github.com/misskey-dev/misskey/releases)
|
5. Create a [release of GitHub](https://github.com/misskey-dev/misskey/releases)
|
||||||
- The target branch must be `master`
|
- The target branch must be `master`
|
||||||
- The tag name must be the version
|
- The tag name must be the version
|
||||||
|
@ -278,9 +278,10 @@ SQLでは配列のインデックスは**1始まり**。
|
||||||
### null IN
|
### null IN
|
||||||
nullが含まれる可能性のあるカラムにINするときは、そのままだとおかしくなるのでORなどでnullのハンドリングをしよう。
|
nullが含まれる可能性のあるカラムにINするときは、そのままだとおかしくなるのでORなどでnullのハンドリングをしよう。
|
||||||
|
|
||||||
### `undefined`にご用心
|
### enumの削除は気をつける
|
||||||
MongoDBの時とは違い、findOneでレコードを取得する時に対象レコードが存在しない場合 **`undefined`** が返ってくるので注意。
|
enumの列挙の内容の削除は、その値をもつレコードを全て削除しないといけない
|
||||||
MongoDBは`null`で返してきてたので、その感覚で`if (x === null)`とか書くとバグる。代わりに`if (x == null)`と書いてください
|
|
||||||
|
削除が重たかったり不可能だったりする場合は、削除しないでおく
|
||||||
|
|
||||||
### Migration作成方法
|
### Migration作成方法
|
||||||
packages/backendで:
|
packages/backendで:
|
||||||
|
|
|
@ -1846,6 +1846,7 @@ _notification:
|
||||||
pollEnded: "アンケートが終了"
|
pollEnded: "アンケートが終了"
|
||||||
receiveFollowRequest: "フォロー申請を受け取った"
|
receiveFollowRequest: "フォロー申請を受け取った"
|
||||||
followRequestAccepted: "フォローが受理された"
|
followRequestAccepted: "フォローが受理された"
|
||||||
|
achievementEarned: "実績の獲得"
|
||||||
app: "連携アプリからの通知"
|
app: "連携アプリからの通知"
|
||||||
|
|
||||||
_actions:
|
_actions:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "13.7.2",
|
"version": "13.7.3",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -11,19 +11,11 @@ export class dropGroup1676434944993 {
|
||||||
await queryRunner.query(`CREATE TYPE "public"."antenna_src_enum" AS ENUM('home', 'all', 'users', 'list')`);
|
await queryRunner.query(`CREATE TYPE "public"."antenna_src_enum" AS ENUM('home', 'all', 'users', 'list')`);
|
||||||
await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum" USING "src"::"text"::"public"."antenna_src_enum"`);
|
await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum" USING "src"::"text"::"public"."antenna_src_enum"`);
|
||||||
await queryRunner.query(`DROP TYPE "public"."antenna_src_enum_old"`);
|
await queryRunner.query(`DROP TYPE "public"."antenna_src_enum_old"`);
|
||||||
await queryRunner.query(`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`);
|
|
||||||
await queryRunner.query(`CREATE TYPE "public"."notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app')`);
|
|
||||||
await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum" USING "type"::"text"::"public"."notification_type_enum"`);
|
|
||||||
await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`);
|
|
||||||
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow","receiveFollowRequest"]'`);
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow","receiveFollowRequest"]'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async down(queryRunner) {
|
async down(queryRunner) {
|
||||||
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow", "receiveFollowRequest", "groupInvited"]'`);
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "emailNotificationTypes" SET DEFAULT '["follow", "receiveFollowRequest", "groupInvited"]'`);
|
||||||
await queryRunner.query(`CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'achievementEarned', 'app')`);
|
|
||||||
await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`);
|
|
||||||
await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`);
|
|
||||||
await queryRunner.query(`ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`);
|
|
||||||
await queryRunner.query(`CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')`);
|
await queryRunner.query(`CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')`);
|
||||||
await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"`);
|
await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"`);
|
||||||
await queryRunner.query(`DROP TYPE "public"."antenna_src_enum"`);
|
await queryRunner.query(`DROP TYPE "public"."antenna_src_enum"`);
|
||||||
|
|
|
@ -94,13 +94,6 @@ export class NotificationEntityService implements OnModuleInit {
|
||||||
}),
|
}),
|
||||||
reaction: notification.reaction,
|
reaction: notification.reaction,
|
||||||
} : {}),
|
} : {}),
|
||||||
...(notification.type === 'pollVote' ? { // TODO: そのうち消す
|
|
||||||
note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, {
|
|
||||||
detail: true,
|
|
||||||
_hint_: options._hintForEachNotes_,
|
|
||||||
}),
|
|
||||||
choice: notification.choice,
|
|
||||||
} : {}),
|
|
||||||
...(notification.type === 'pollEnded' ? {
|
...(notification.type === 'pollEnded' ? {
|
||||||
note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, {
|
note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, {
|
||||||
detail: true,
|
detail: true,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Entity, Index, JoinColumn, ManyToOne, Column, PrimaryColumn } from 'typeorm';
|
import { Entity, Index, JoinColumn, ManyToOne, Column, PrimaryColumn } from 'typeorm';
|
||||||
import { notificationTypes } from '@/types.js';
|
import { notificationTypes, obsoleteNotificationTypes } from '@/types.js';
|
||||||
import { id } from '../id.js';
|
import { id } from '../id.js';
|
||||||
import { User } from './User.js';
|
import { User } from './User.js';
|
||||||
import { Note } from './Note.js';
|
import { Note } from './Note.js';
|
||||||
|
@ -58,7 +58,6 @@ export class Notification {
|
||||||
* renote - 投稿がRenoteされた
|
* renote - 投稿がRenoteされた
|
||||||
* quote - 投稿が引用Renoteされた
|
* quote - 投稿が引用Renoteされた
|
||||||
* reaction - 投稿にリアクションされた
|
* reaction - 投稿にリアクションされた
|
||||||
* pollVote - 投稿のアンケートに投票された (廃止)
|
|
||||||
* pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した
|
* pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した
|
||||||
* receiveFollowRequest - フォローリクエストされた
|
* receiveFollowRequest - フォローリクエストされた
|
||||||
* followRequestAccepted - 自分の送ったフォローリクエストが承認された
|
* followRequestAccepted - 自分の送ったフォローリクエストが承認された
|
||||||
|
@ -67,7 +66,10 @@ export class Notification {
|
||||||
*/
|
*/
|
||||||
@Index()
|
@Index()
|
||||||
@Column('enum', {
|
@Column('enum', {
|
||||||
enum: notificationTypes,
|
enum: [
|
||||||
|
...notificationTypes,
|
||||||
|
...obsoleteNotificationTypes,
|
||||||
|
],
|
||||||
comment: 'The type of the Notification.',
|
comment: 'The type of the Notification.',
|
||||||
})
|
})
|
||||||
public type: typeof notificationTypes[number];
|
public type: typeof notificationTypes[number];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
|
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
|
||||||
import { ffVisibility, notificationTypes } from '@/types.js';
|
import { obsoleteNotificationTypes, ffVisibility, notificationTypes } from '@/types.js';
|
||||||
import { id } from '../id.js';
|
import { id } from '../id.js';
|
||||||
import { User } from './User.js';
|
import { User } from './User.js';
|
||||||
import { Page } from './Page.js';
|
import { Page } from './Page.js';
|
||||||
|
@ -205,7 +205,7 @@ export class UserProfile {
|
||||||
enum: [
|
enum: [
|
||||||
...notificationTypes,
|
...notificationTypes,
|
||||||
// マイグレーションで削除が困難なので古いenumは残しておく
|
// マイグレーションで削除が困難なので古いenumは残しておく
|
||||||
'groupInvited',
|
...obsoleteNotificationTypes,
|
||||||
],
|
],
|
||||||
array: true,
|
array: true,
|
||||||
default: [],
|
default: [],
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Brackets } from 'typeorm';
|
import { Brackets } from 'typeorm';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import type { UsersRepository, FollowingsRepository, MutingsRepository, UserProfilesRepository, NotificationsRepository } from '@/models/index.js';
|
import type { UsersRepository, FollowingsRepository, MutingsRepository, UserProfilesRepository, NotificationsRepository } from '@/models/index.js';
|
||||||
import { notificationTypes } from '@/types.js';
|
import { obsoleteNotificationTypes, notificationTypes } from '@/types.js';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { NoteReadService } from '@/core/NoteReadService.js';
|
import { NoteReadService } from '@/core/NoteReadService.js';
|
||||||
|
@ -41,11 +41,12 @@ export const paramDef = {
|
||||||
following: { type: 'boolean', default: false },
|
following: { type: 'boolean', default: false },
|
||||||
unreadOnly: { type: 'boolean', default: false },
|
unreadOnly: { type: 'boolean', default: false },
|
||||||
markAsRead: { type: 'boolean', default: true },
|
markAsRead: { type: 'boolean', default: true },
|
||||||
|
// 後方互換のため、廃止された通知タイプも受け付ける
|
||||||
includeTypes: { type: 'array', items: {
|
includeTypes: { type: 'array', items: {
|
||||||
type: 'string', enum: notificationTypes,
|
type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes],
|
||||||
} },
|
} },
|
||||||
excludeTypes: { type: 'array', items: {
|
excludeTypes: { type: 'array', items: {
|
||||||
type: 'string', enum: notificationTypes,
|
type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes],
|
||||||
} },
|
} },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
|
@ -84,6 +85,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
if (notificationTypes.every(type => ps.excludeTypes?.includes(type))) {
|
if (notificationTypes.every(type => ps.excludeTypes?.includes(type))) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const includeTypes = ps.includeTypes && ps.includeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][];
|
||||||
|
const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][];
|
||||||
|
|
||||||
const followingQuery = this.followingsRepository.createQueryBuilder('following')
|
const followingQuery = this.followingsRepository.createQueryBuilder('following')
|
||||||
.select('following.followeeId')
|
.select('following.followeeId')
|
||||||
.where('following.followerId = :followerId', { followerId: me.id });
|
.where('following.followerId = :followerId', { followerId: me.id });
|
||||||
|
@ -143,10 +148,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
query.setParameters(followingQuery.getParameters());
|
query.setParameters(followingQuery.getParameters());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.includeTypes && ps.includeTypes.length > 0) {
|
if (includeTypes && includeTypes.length > 0) {
|
||||||
query.andWhere('notification.type IN (:...includeTypes)', { includeTypes: ps.includeTypes });
|
query.andWhere('notification.type IN (:...includeTypes)', { includeTypes });
|
||||||
} else if (ps.excludeTypes && ps.excludeTypes.length > 0) {
|
} else if (excludeTypes && excludeTypes.length > 0) {
|
||||||
query.andWhere('notification.type NOT IN (:...excludeTypes)', { excludeTypes: ps.excludeTypes });
|
query.andWhere('notification.type NOT IN (:...excludeTypes)', { excludeTypes });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.unreadOnly) {
|
if (ps.unreadOnly) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const;
|
export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const;
|
||||||
|
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;
|
||||||
|
|
||||||
export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const;
|
export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
:with-ok-button="true"
|
:with-ok-button="true"
|
||||||
:ok-button-disabled="false"
|
:ok-button-disabled="false"
|
||||||
@ok="ok()"
|
@ok="ok()"
|
||||||
@close="dialog.close()"
|
@close="dialog?.close()"
|
||||||
@closed="emit('closed')"
|
@closed="emit('closed')"
|
||||||
>
|
>
|
||||||
<template #header>{{ i18n.ts.notificationSetting }}</template>
|
<template #header>{{ i18n.ts.notificationSetting }}</template>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
<MkButton inline @click="disableAll">{{ i18n.ts.disableAll }}</MkButton>
|
<MkButton inline @click="disableAll">{{ i18n.ts.disableAll }}</MkButton>
|
||||||
<MkButton inline @click="enableAll">{{ i18n.ts.enableAll }}</MkButton>
|
<MkButton inline @click="enableAll">{{ i18n.ts.enableAll }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
<MkSwitch v-for="ntype in notificationTypes" :key="ntype" v-model="typesMap[ntype]">{{ i18n.t(`_notification._types.${ntype}`) }}</MkSwitch>
|
<MkSwitch v-for="ntype in notificationTypes" :key="ntype" v-model="typesMap[ntype].value">{{ i18n.t(`_notification._types.${ntype}`) }}</MkSwitch>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
|
@ -33,14 +33,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { } from 'vue';
|
import { ref, Ref } from 'vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
|
||||||
import MkSwitch from './MkSwitch.vue';
|
import MkSwitch from './MkSwitch.vue';
|
||||||
import MkInfo from './MkInfo.vue';
|
import MkInfo from './MkInfo.vue';
|
||||||
import MkButton from './MkButton.vue';
|
import MkButton from './MkButton.vue';
|
||||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
|
import { notificationTypes } from '@/const';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
|
||||||
|
type TypesMap = Record<typeof notificationTypes[number], Ref<boolean>>
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'done', v: { includingTypes: string[] | null }): void,
|
(ev: 'done', v: { includingTypes: string[] | null }): void,
|
||||||
(ev: 'closed'): void,
|
(ev: 'closed'): void,
|
||||||
|
@ -54,39 +56,35 @@ const props = withDefaults(defineProps<{
|
||||||
showGlobalToggle: true,
|
showGlobalToggle: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let includingTypes = $computed(() => props.includingTypes ?? []);
|
let includingTypes = $computed(() => props.includingTypes?.filter(x => notificationTypes.includes(x)) ?? []);
|
||||||
|
|
||||||
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
||||||
|
|
||||||
let typesMap = $ref<Record<typeof notificationTypes[number], boolean>>({});
|
const typesMap: TypesMap = notificationTypes.reduce((p, t) => ({ ...p, [t]: ref<boolean>(includingTypes.includes(t)) }), {} as any);
|
||||||
let useGlobalSetting = $ref((includingTypes === null || includingTypes.length === 0) && props.showGlobalToggle);
|
let useGlobalSetting = $ref((includingTypes === null || includingTypes.length === 0) && props.showGlobalToggle);
|
||||||
|
|
||||||
for (const ntype of notificationTypes) {
|
|
||||||
typesMap[ntype] = includingTypes.includes(ntype);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ok() {
|
function ok() {
|
||||||
if (useGlobalSetting) {
|
if (useGlobalSetting) {
|
||||||
emit('done', { includingTypes: null });
|
emit('done', { includingTypes: null });
|
||||||
} else {
|
} else {
|
||||||
emit('done', {
|
emit('done', {
|
||||||
includingTypes: (Object.keys(typesMap) as typeof notificationTypes[number][])
|
includingTypes: (Object.keys(typesMap) as typeof notificationTypes[number][])
|
||||||
.filter(type => typesMap[type]),
|
.filter(type => typesMap[type].value),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.close();
|
if (dialog) dialog.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableAll() {
|
function disableAll() {
|
||||||
for (const type in typesMap) {
|
for (const type of notificationTypes) {
|
||||||
typesMap[type as typeof notificationTypes[number]] = false;
|
typesMap[type].value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableAll() {
|
function enableAll() {
|
||||||
for (const type in typesMap) {
|
for (const type of notificationTypes) {
|
||||||
typesMap[type as typeof notificationTypes[number]] = true;
|
typesMap[type].value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onUnmounted, onMounted, computed, shallowRef } from 'vue';
|
import { onUnmounted, onMounted, computed, shallowRef } from 'vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
|
||||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||||
import XNotification from '@/components/MkNotification.vue';
|
import XNotification from '@/components/MkNotification.vue';
|
||||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
||||||
|
@ -26,6 +25,7 @@ import XNote from '@/components/MkNote.vue';
|
||||||
import { stream } from '@/stream';
|
import { stream } from '@/stream';
|
||||||
import { $i } from '@/account';
|
import { $i } from '@/account';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
import { notificationTypes } from '@/const';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
includeTypes?: typeof notificationTypes[number][];
|
includeTypes?: typeof notificationTypes[number][];
|
||||||
|
|
|
@ -43,3 +43,6 @@ https://github.com/sindresorhus/file-type/blob/main/supported.js
|
||||||
https://github.com/sindresorhus/file-type/blob/main/core.js
|
https://github.com/sindresorhus/file-type/blob/main/core.js
|
||||||
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const;
|
||||||
|
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
|
||||||
import XNotifications from '@/components/MkNotifications.vue';
|
import XNotifications from '@/components/MkNotifications.vue';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
|
import { notificationTypes } from '@/const';
|
||||||
|
|
||||||
let tab = $ref('all');
|
let tab = $ref('all');
|
||||||
let includeTypes = $ref<string[] | null>(null);
|
let includeTypes = $ref<string[] | null>(null);
|
||||||
|
|
|
@ -181,7 +181,7 @@ const menuDef = computed(() => [{
|
||||||
miLocalStorage.removeItem('theme');
|
miLocalStorage.removeItem('theme');
|
||||||
miLocalStorage.removeItem('emojis');
|
miLocalStorage.removeItem('emojis');
|
||||||
miLocalStorage.removeItem('lastEmojisFetchedAt');
|
miLocalStorage.removeItem('lastEmojisFetchedAt');
|
||||||
await fetchCustomEmojis();
|
await fetchCustomEmojis(true);
|
||||||
unisonReload();
|
unisonReload();
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent } from 'vue';
|
import { defineAsyncComponent } from 'vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
|
||||||
import FormLink from '@/components/form/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
|
@ -36,6 +35,7 @@ import { $i } from '@/account';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||||
import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue';
|
import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue';
|
||||||
|
import { notificationTypes } from '@/const';
|
||||||
|
|
||||||
let allowButton = $shallowRef<InstanceType<typeof MkPushNotificationAllowButton>>();
|
let allowButton = $shallowRef<InstanceType<typeof MkPushNotificationAllowButton>>();
|
||||||
let pushRegistrationInServer = $computed(() => allowButton?.pushRegistrationInServer);
|
let pushRegistrationInServer = $computed(() => allowButton?.pushRegistrationInServer);
|
||||||
|
|
|
@ -98,6 +98,7 @@ import { $i } from '@/account';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { mainRouter } from '@/router';
|
import { mainRouter } from '@/router';
|
||||||
import { unisonReload } from '@/scripts/unison-reload';
|
import { unisonReload } from '@/scripts/unison-reload';
|
||||||
|
import { deviceKind } from '@/scripts/device-kind';
|
||||||
const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue'));
|
const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue'));
|
||||||
|
|
||||||
mainRouter.navHook = (path, flag): boolean => {
|
mainRouter.navHook = (path, flag): boolean => {
|
||||||
|
@ -115,7 +116,7 @@ window.addEventListener('resize', () => {
|
||||||
isMobile.value = window.innerWidth <= 500;
|
isMobile.value = window.innerWidth <= 500;
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapScroll = isMobile;
|
const snapScroll = deviceKind === 'smartphone' || deviceKind === 'tablet';
|
||||||
const drawerMenuShowing = ref(false);
|
const drawerMenuShowing = ref(false);
|
||||||
|
|
||||||
const route = 'TODO';
|
const route = 'TODO';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mkw-onlineUsers data-cy-mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }">
|
<div class="mkw-onlineUsers data-cy-mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }">
|
||||||
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" text-tag="span" class="text">
|
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" text-tag="span" class="text">
|
||||||
<template #n><b>{{ onlineUsersCount }}</b></template>
|
<template #n><b>{{ number(onlineUsersCount) }}</b></template>
|
||||||
</I18n>
|
</I18n>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -13,6 +13,7 @@ import { GetFormResultType } from '@/scripts/form';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { useInterval } from '@/scripts/use-interval';
|
import { useInterval } from '@/scripts/use-interval';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
import number from '@/filters/number';
|
||||||
|
|
||||||
const name = 'onlineUsers';
|
const name = 'onlineUsers';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue