Просмотр исходного кода

fix(core): fix typo in notifications, closes #2330 (#2331)

* fix(core): fix typo in notifications, closes #2330

* Update core-notification-typo.md

* [skip ci]
Amr Bashir 4 лет назад
Родитель
Сommit
cf9f6aa148
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      .changes/core-notification-typo.md
  2. 1 1
      core/tauri/scripts/core.js

+ 5 - 0
.changes/core-notification-typo.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fix `Notification.requestPermission()` throwing `Unhandled Promise Rejection: TypeError: undefined is not a function (near '...window.__TAURI__.invoke...')`

+ 1 - 1
core/tauri/scripts/core.js

@@ -260,7 +260,7 @@ if (!String.prototype.startsWith) {
 
   function requestPermission() {
     return window.__TAURI__
-      .invoke(
+      ._invoke(
         'tauri',
         {
           __tauriModule: 'Notification',