Prechádzať zdrojové kódy

fix(api): Fix monitor functions, closes #2294 (#2301)

Co-authored-by: Amr Bashir <48618675+amrbashir@users.noreply.github.com>
FabianLars 4 rokov pred
rodič
commit
0f63f5e757

+ 6 - 0
.changes/fix-monitor-api.md

@@ -0,0 +1,6 @@
+---
+"api": patch
+---
+
+- Fixes monitor api not working. 
+- Fixes window.print() not working on macOS.

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
core/tauri/scripts/bundle.js


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

@@ -371,7 +371,12 @@ if (!String.prototype.startsWith) {
         {
           __tauriModule: 'Window',
           message: {
-            cmd: 'print'
+            cmd: 'manage',
+            data: {
+              cmd: {
+                type: 'print'
+              }
+            }
           }
         },
         _KEY_VALUE_

+ 18 - 3
tooling/api/src/window.ts

@@ -1167,7 +1167,12 @@ async function currentMonitor(): Promise<Monitor | null> {
   return invokeTauriCommand({
     __tauriModule: 'Window',
     message: {
-      cmd: 'currentMonitor'
+      cmd: 'manage',
+      data: {
+        cmd: {
+          type: 'currentMonitor'
+        }
+      }
     }
   })
 }
@@ -1180,7 +1185,12 @@ async function primaryMonitor(): Promise<Monitor | null> {
   return invokeTauriCommand({
     __tauriModule: 'Window',
     message: {
-      cmd: 'primaryMonitor'
+      cmd: 'manage',
+      data: {
+        cmd: {
+          type: 'primaryMonitor'
+        }
+      }
     }
   })
 }
@@ -1190,7 +1200,12 @@ async function availableMonitors(): Promise<Monitor[]> {
   return invokeTauriCommand({
     __tauriModule: 'Window',
     message: {
-      cmd: 'availableMonitors'
+      cmd: 'manage',
+      data: {
+        cmd: {
+          type: 'availableMonitors'
+        }
+      }
     }
   })
 }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov