diff --git a/CHANGELOG.md b/CHANGELOG.md index 330ad97c624965ab470d8afcb3a9763a97b14b25..2521396b0b9baf7180698593cd72e9ac63c67db9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ 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) ### Note diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48d8a40deae21c778bcaacb0d0496ac7965c1b8e..a8322d7b920b776897b1dc8a3679666e8360d689 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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`. - `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. -4. Merge it. +4. Merge it. (Do not squash commit) 5. Create a [release of GitHub](https://github.com/misskey-dev/misskey/releases) - The target branch must be `master` - The tag name must be the version @@ -278,9 +278,10 @@ SQLã§ã¯é…列ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã¯**1始ã¾ã‚Š**。 ### null IN nullãŒå«ã¾ã‚Œã‚‹å¯èƒ½æ€§ã®ã‚るカラムã«INã™ã‚‹ã¨ãã¯ã€ãã®ã¾ã¾ã ã¨ãŠã‹ã—ããªã‚‹ã®ã§ORãªã©ã§nullã®ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°ã‚’ã—よã†ã€‚ -### `undefined`ã«ã”用心 -MongoDBã®æ™‚ã¨ã¯é•ã„ã€findOneã§ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’å–å¾—ã™ã‚‹æ™‚ã«å¯¾è±¡ãƒ¬ã‚³ãƒ¼ãƒ‰ãŒå˜åœ¨ã—ãªã„å ´åˆ **`undefined`** ãŒè¿”ã£ã¦ãã‚‹ã®ã§æ³¨æ„。 -MongoDBã¯`null`ã§è¿”ã—ã¦ãã¦ãŸã®ã§ã€ãã®æ„Ÿè¦šã§`if (x === null)`ã¨ã‹æ›¸ãã¨ãƒã‚°ã‚‹ã€‚代ã‚ã‚Šã«`if (x == null)`ã¨æ›¸ã„ã¦ãã ã•ã„ +### enumã®å‰Šé™¤ã¯æ°—ã‚’ã¤ã‘ã‚‹ +enumã®åˆ—挙ã®å†…容ã®å‰Šé™¤ã¯ã€ãã®å€¤ã‚’ã‚‚ã¤ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’å…¨ã¦å‰Šé™¤ã—ãªã„ã¨ã„ã‘ãªã„ + +削除ãŒé‡ãŸã‹ã£ãŸã‚Šä¸å¯èƒ½ã ã£ãŸã‚Šã™ã‚‹å ´åˆã¯ã€å‰Šé™¤ã—ãªã„ã§ãŠã ### Migration作æˆæ–¹æ³• packages/backendã§: diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3faab45007a4dcaba969e0f8600fbad1f5cb84aa..5ba5f647696d1604de087ae1e33c11c11e44b9d6 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1846,6 +1846,7 @@ _notification: pollEnded: "アンケートãŒçµ‚了" receiveFollowRequest: "フォãƒãƒ¼ç”³è«‹ã‚’å—ã‘å–ã£ãŸ" followRequestAccepted: "フォãƒãƒ¼ãŒå—ç†ã•ã‚ŒãŸ" + achievementEarned: "実績ã®ç²å¾—" app: "連æºã‚¢ãƒ—リã‹ã‚‰ã®é€šçŸ¥" _actions: diff --git a/package.json b/package.json index b0501eb02a553ba5de4b7a62818d25f910d533c8..ad6f0f71dbe55e9f7848f82b32214c0039b3db7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "13.7.2", + "version": "13.7.3", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/backend/migration/1676434944993-drop-group.js b/packages/backend/migration/1676434944993-drop-group.js index df4a3b6839ca6c5b191a653355525b495fcf71ac..0f29664338201546d9f33b47687361d77e4d768b 100644 --- a/packages/backend/migration/1676434944993-drop-group.js +++ b/packages/backend/migration/1676434944993-drop-group.js @@ -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(`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(`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"]'`); } async down(queryRunner) { 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(`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"`); diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index 34ff52ede84ca842d89d0d44cf521c083b8d6f80..33c76c69370a742f6885dc525f972595f504d33e 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -94,13 +94,6 @@ export class NotificationEntityService implements OnModuleInit { }), 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' ? { note: this.noteEntityService.pack(notification.note ?? notification.noteId!, { id: notification.notifieeId }, { detail: true, diff --git a/packages/backend/src/models/entities/Notification.ts b/packages/backend/src/models/entities/Notification.ts index 105f0d0407bdb6c36fb00df1ee8359970d5b8d51..51117efba53c484dd4eb4e9e7bedf44095df4f3e 100644 --- a/packages/backend/src/models/entities/Notification.ts +++ b/packages/backend/src/models/entities/Notification.ts @@ -1,5 +1,5 @@ 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 { User } from './User.js'; import { Note } from './Note.js'; @@ -58,7 +58,6 @@ export class Notification { * renote - 投稿ãŒRenoteã•ã‚ŒãŸ * quote - 投稿ãŒå¼•ç”¨Renoteã•ã‚ŒãŸ * reaction - 投稿ã«ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã•ã‚ŒãŸ - * pollVote - 投稿ã®ã‚¢ãƒ³ã‚±ãƒ¼ãƒˆã«æŠ•ç¥¨ã•ã‚ŒãŸ (廃æ¢) * pollEnded - 自分ã®ã‚¢ãƒ³ã‚±ãƒ¼ãƒˆã‚‚ã—ãã¯è‡ªåˆ†ãŒæŠ•ç¥¨ã—ãŸã‚¢ãƒ³ã‚±ãƒ¼ãƒˆãŒçµ‚了ã—㟠* receiveFollowRequest - フォãƒãƒ¼ãƒªã‚¯ã‚¨ã‚¹ãƒˆã•ã‚ŒãŸ * followRequestAccepted - 自分ã®é€ã£ãŸãƒ•ã‚©ãƒãƒ¼ãƒªã‚¯ã‚¨ã‚¹ãƒˆãŒæ‰¿èªã•ã‚ŒãŸ @@ -67,7 +66,10 @@ export class Notification { */ @Index() @Column('enum', { - enum: notificationTypes, + enum: [ + ...notificationTypes, + ...obsoleteNotificationTypes, + ], comment: 'The type of the Notification.', }) public type: typeof notificationTypes[number]; diff --git a/packages/backend/src/models/entities/UserProfile.ts b/packages/backend/src/models/entities/UserProfile.ts index 3d35b4cb5ae5ff31d89db6ac3fd728f2ec5f39e0..60c1c55de5d371f456c904b0e77d4bf2b1313a99 100644 --- a/packages/backend/src/models/entities/UserProfile.ts +++ b/packages/backend/src/models/entities/UserProfile.ts @@ -1,5 +1,5 @@ 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 { User } from './User.js'; import { Page } from './Page.js'; @@ -205,7 +205,7 @@ export class UserProfile { enum: [ ...notificationTypes, // マイグレーションã§å‰Šé™¤ãŒå›°é›£ãªã®ã§å¤ã„enumã¯æ®‹ã—ã¦ãŠã - 'groupInvited', + ...obsoleteNotificationTypes, ], array: true, default: [], diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 706e0d2089cb3b4aeca6a7cf9f24191155e58dff..e3897d38bd881848cef23d77e7fc16d56d67a912 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -1,7 +1,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; 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 { QueryService } from '@/core/QueryService.js'; import { NoteReadService } from '@/core/NoteReadService.js'; @@ -41,11 +41,12 @@ export const paramDef = { following: { type: 'boolean', default: false }, unreadOnly: { type: 'boolean', default: false }, markAsRead: { type: 'boolean', default: true }, + // 後方互æ›ã®ãŸã‚ã€å»ƒæ¢ã•ã‚ŒãŸé€šçŸ¥ã‚¿ã‚¤ãƒ—ã‚‚å—ã‘付ã‘ã‚‹ includeTypes: { type: 'array', items: { - type: 'string', enum: notificationTypes, + type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes], } }, excludeTypes: { type: 'array', items: { - type: 'string', enum: notificationTypes, + type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes], } }, }, required: [], @@ -84,6 +85,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { if (notificationTypes.every(type => ps.excludeTypes?.includes(type))) { 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') .select('following.followeeId') .where('following.followerId = :followerId', { followerId: me.id }); @@ -143,10 +148,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { query.setParameters(followingQuery.getParameters()); } - if (ps.includeTypes && ps.includeTypes.length > 0) { - query.andWhere('notification.type IN (:...includeTypes)', { includeTypes: ps.includeTypes }); - } else if (ps.excludeTypes && ps.excludeTypes.length > 0) { - query.andWhere('notification.type NOT IN (:...excludeTypes)', { excludeTypes: ps.excludeTypes }); + if (includeTypes && includeTypes.length > 0) { + query.andWhere('notification.type IN (:...includeTypes)', { includeTypes }); + } else if (excludeTypes && excludeTypes.length > 0) { + query.andWhere('notification.type NOT IN (:...excludeTypes)', { excludeTypes }); } if (ps.unreadOnly) { diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 8ac65a021cc2bcb0d8d183dc79fa5394e7d41c5b..7c6a1e5199cbb4bdac34342fc85a5fc7e543692e 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -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; diff --git a/packages/frontend/src/components/MkNotificationSettingWindow.vue b/packages/frontend/src/components/MkNotificationSettingWindow.vue index 2d8d30e337a359dd937b0cf32ac2663525f6b44f..f6d0e5681ddf10aaeed7ab9493722dac0fd94c7b 100644 --- a/packages/frontend/src/components/MkNotificationSettingWindow.vue +++ b/packages/frontend/src/components/MkNotificationSettingWindow.vue @@ -6,7 +6,7 @@ :with-ok-button="true" :ok-button-disabled="false" @ok="ok()" - @close="dialog.close()" + @close="dialog?.close()" @closed="emit('closed')" > <template #header>{{ i18n.ts.notificationSetting }}</template> @@ -25,7 +25,7 @@ <MkButton inline @click="disableAll">{{ i18n.ts.disableAll }}</MkButton> <MkButton inline @click="enableAll">{{ i18n.ts.enableAll }}</MkButton> </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> </div> </MkSpacer> @@ -33,14 +33,16 @@ </template> <script lang="ts" setup> -import { } from 'vue'; -import { notificationTypes } from 'misskey-js'; +import { ref, Ref } from 'vue'; import MkSwitch from './MkSwitch.vue'; import MkInfo from './MkInfo.vue'; import MkButton from './MkButton.vue'; import MkModalWindow from '@/components/MkModalWindow.vue'; +import { notificationTypes } from '@/const'; import { i18n } from '@/i18n'; +type TypesMap = Record<typeof notificationTypes[number], Ref<boolean>> + const emit = defineEmits<{ (ev: 'done', v: { includingTypes: string[] | null }): void, (ev: 'closed'): void, @@ -54,39 +56,35 @@ const props = withDefaults(defineProps<{ showGlobalToggle: true, }); -let includingTypes = $computed(() => props.includingTypes ?? []); +let includingTypes = $computed(() => props.includingTypes?.filter(x => notificationTypes.includes(x)) ?? []); 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); -for (const ntype of notificationTypes) { - typesMap[ntype] = includingTypes.includes(ntype); -} - function ok() { if (useGlobalSetting) { emit('done', { includingTypes: null }); } else { emit('done', { 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() { - for (const type in typesMap) { - typesMap[type as typeof notificationTypes[number]] = false; + for (const type of notificationTypes) { + typesMap[type].value = false; } } function enableAll() { - for (const type in typesMap) { - typesMap[type as typeof notificationTypes[number]] = true; + for (const type of notificationTypes) { + typesMap[type].value = true; } } </script> diff --git a/packages/frontend/src/components/MkNotifications.vue b/packages/frontend/src/components/MkNotifications.vue index 37ce7635a3aa038e602c922fcc76e88b09817386..93b1c3705571eafb1074ca9b5e8fedcd5d327660 100644 --- a/packages/frontend/src/components/MkNotifications.vue +++ b/packages/frontend/src/components/MkNotifications.vue @@ -18,7 +18,6 @@ <script lang="ts" setup> import { onUnmounted, onMounted, computed, shallowRef } from 'vue'; -import { notificationTypes } from 'misskey-js'; import MkPagination, { Paging } from '@/components/MkPagination.vue'; import XNotification from '@/components/MkNotification.vue'; import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; @@ -26,6 +25,7 @@ import XNote from '@/components/MkNote.vue'; import { stream } from '@/stream'; import { $i } from '@/account'; import { i18n } from '@/i18n'; +import { notificationTypes } from '@/const'; const props = defineProps<{ includeTypes?: typeof notificationTypes[number][]; diff --git a/packages/frontend/src/const.ts b/packages/frontend/src/const.ts index 77366cf07b96d378b691d30c512807724e465aef..1d44786a633ca5225a37ef66d1429c429ea4db32 100644 --- a/packages/frontend/src/const.ts +++ b/packages/frontend/src/const.ts @@ -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://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; diff --git a/packages/frontend/src/pages/notifications.vue b/packages/frontend/src/pages/notifications.vue index 0fcf0f65c421305051ae98db42cf877d87b332c4..da64a4c1e0029b0f2bcb40616831b26fa9a8318c 100644 --- a/packages/frontend/src/pages/notifications.vue +++ b/packages/frontend/src/pages/notifications.vue @@ -17,12 +17,12 @@ <script lang="ts" setup> import { computed } from 'vue'; -import { notificationTypes } from 'misskey-js'; import XNotifications from '@/components/MkNotifications.vue'; import MkNotes from '@/components/MkNotes.vue'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { notificationTypes } from '@/const'; let tab = $ref('all'); let includeTypes = $ref<string[] | null>(null); diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue index e6752460a8dde7f34d21e50f9a334fc1c2452546..a5619eab86db37eb945eee60aaf1beecff4767ae 100644 --- a/packages/frontend/src/pages/settings/index.vue +++ b/packages/frontend/src/pages/settings/index.vue @@ -181,7 +181,7 @@ const menuDef = computed(() => [{ miLocalStorage.removeItem('theme'); miLocalStorage.removeItem('emojis'); miLocalStorage.removeItem('lastEmojisFetchedAt'); - await fetchCustomEmojis(); + await fetchCustomEmojis(true); unisonReload(); }, }, { diff --git a/packages/frontend/src/pages/settings/notifications.vue b/packages/frontend/src/pages/settings/notifications.vue index f64202fff2af4437c04f7d8c7c56bf18f8c17147..2cf2f6d7f65080a38c403f8b5fdc5ba1a70e40ce 100644 --- a/packages/frontend/src/pages/settings/notifications.vue +++ b/packages/frontend/src/pages/settings/notifications.vue @@ -27,7 +27,6 @@ <script lang="ts" setup> import { defineAsyncComponent } from 'vue'; -import { notificationTypes } from 'misskey-js'; import FormLink from '@/components/form/link.vue'; import FormSection from '@/components/form/section.vue'; import MkSwitch from '@/components/MkSwitch.vue'; @@ -36,6 +35,7 @@ import { $i } from '@/account'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue'; +import { notificationTypes } from '@/const'; let allowButton = $shallowRef<InstanceType<typeof MkPushNotificationAllowButton>>(); let pushRegistrationInServer = $computed(() => allowButton?.pushRegistrationInServer); diff --git a/packages/frontend/src/ui/deck.vue b/packages/frontend/src/ui/deck.vue index 4e933595916619e7c6cf22401aca391c46c2e248..be168b4282932c752403d2151c38da2db8a19381 100644 --- a/packages/frontend/src/ui/deck.vue +++ b/packages/frontend/src/ui/deck.vue @@ -98,6 +98,7 @@ import { $i } from '@/account'; import { i18n } from '@/i18n'; import { mainRouter } from '@/router'; import { unisonReload } from '@/scripts/unison-reload'; +import { deviceKind } from '@/scripts/device-kind'; const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue')); mainRouter.navHook = (path, flag): boolean => { @@ -115,7 +116,7 @@ window.addEventListener('resize', () => { isMobile.value = window.innerWidth <= 500; }); -const snapScroll = isMobile; +const snapScroll = deviceKind === 'smartphone' || deviceKind === 'tablet'; const drawerMenuShowing = ref(false); const route = 'TODO'; diff --git a/packages/frontend/src/widgets/WidgetOnlineUsers.vue b/packages/frontend/src/widgets/WidgetOnlineUsers.vue index a096cc8fe8f7dacb5a18a604acfaf7d7d6f68c99..7949fc4a93759481c1ea9226670f7ef1586c218a 100644 --- a/packages/frontend/src/widgets/WidgetOnlineUsers.vue +++ b/packages/frontend/src/widgets/WidgetOnlineUsers.vue @@ -1,7 +1,7 @@ <template> <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"> - <template #n><b>{{ onlineUsersCount }}</b></template> + <template #n><b>{{ number(onlineUsersCount) }}</b></template> </I18n> </div> </template> @@ -13,6 +13,7 @@ import { GetFormResultType } from '@/scripts/form'; import * as os from '@/os'; import { useInterval } from '@/scripts/use-interval'; import { i18n } from '@/i18n'; +import number from '@/filters/number'; const name = 'onlineUsers';