diff --git a/CHANGELOG.md b/CHANGELOG.md index afecb18d72..93a7254bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Client - Enhance: 管理しているチャンネルの見分けがつきやすくなるように +- Enhance: プッシュ通知を行うための権限確認をより確実に行うように - Fix: 紙吹雪エフェクトがアニメーション設定を考慮せず常に表示される問題を修正 - Fix: ナビゲーションバーのリアルタイムモード切替ボタンの状態をよりわかりやすく表示するように - Fix: ページのタイトルが長いとき、はみ出る問題を修正 diff --git a/locales/index.d.ts b/locales/index.d.ts index 3a80467e8d..45ecb87095 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4106,6 +4106,18 @@ export interface Locale extends ILocale { * 端末の電池消費量が増加する可能性があります。 */ "sendPushNotificationReadMessageCaption": string; + /** + * ブラウザの通知設定を許可してください + */ + "pleaseAllowPushNotification": string; + /** + * 通知の送信権限の取得に失敗しました + */ + "browserPushNotificationDisabled": string; + /** + * {serverName}から通知を送信する権限がありません。ブラウザの設定から通知を許可して再度お試しください。 + */ + "browserPushNotificationDisabledDescription": ParameterizedString<"serverName">; /** * 最大化 */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 84d651ec3b..6e7420e29e 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1022,6 +1022,9 @@ pushNotificationAlreadySubscribed: "プッシュ通知は有効です" pushNotificationNotSupported: "ブラウザかサーバーがプッシュ通知に非対応" sendPushNotificationReadMessage: "通知が既読になったらプッシュ通知を削除する" sendPushNotificationReadMessageCaption: "端末の電池消費量が増加する可能性があります。" +pleaseAllowPushNotification: "ブラウザの通知設定を許可してください" +browserPushNotificationDisabled: "通知の送信権限の取得に失敗しました" +browserPushNotificationDisabledDescription: "{serverName}から通知を送信する権限がありません。ブラウザの設定から通知を許可して再度お試しください。" windowMaximize: "最大化" windowMinimize: "最小化" windowRestore: "元に戻す" diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 18817d3f79..10b1199bbb 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -303,13 +303,6 @@ export async function mainBoot() { }); } - if ('Notification' in window) { - // 許可を得ていなかったらリクエスト - if (Notification.permission === 'default') { - Notification.requestPermission(); - } - } - if (store.s.realtimeMode) { const stream = useStream(); diff --git a/packages/frontend/src/components/MkPushNotificationAllowButton.vue b/packages/frontend/src/components/MkPushNotificationAllowButton.vue index 697346020c..38441b0ea6 100644 --- a/packages/frontend/src/components/MkPushNotificationAllowButton.vue +++ b/packages/frontend/src/components/MkPushNotificationAllowButton.vue @@ -42,10 +42,11 @@ SPDX-License-Identifier: AGPL-3.0-only