Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

進行水球通知時檢查權限並且要求權限 #78

Open
PichuChen opened this issue Jan 16, 2021 · 0 comments
Open

進行水球通知時檢查權限並且要求權限 #78

PichuChen opened this issue Jan 16, 2021 · 0 comments

Comments

@PichuChen
Copy link

使用環境:
作業系統: OSX
瀏覽器: Chrome

目前水球來的時候不會跳通知,沒有 notification 應該是被瀏覽器擋下來了
建議在 term_view.js 的 showWaterballNotification 新增

    if (Notification.permission != 'granted') {
      Notification.requestPermission()
    }

來解決這個問題。
原先的程式碼是這樣:

 showWaterballNotification: function() {
    if (!this.enableNotifications) {
      return;
    }
    var app = this.bbscore;

修改成:

 showWaterballNotification: function() {
    if (!this.enableNotifications) {
      return;
    }
    if (Notification.permission != 'granted') {
      Notification.requestPermission()
    }
    var app = this.bbscore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant