Upgrade Tauri dependencies

This commit is contained in:
Gregory Schier
2024-07-28 13:44:50 -07:00
parent ad3c2ed113
commit 6e156497da
19 changed files with 807 additions and 716 deletions

View File

@@ -1,5 +1,5 @@
import { useQueryClient } from '@tanstack/react-query';
import { getCurrent } from '@tauri-apps/api/webviewWindow';
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import { useEffect } from 'react';
import { useAtiveWorkspaceChangedToast } from '../hooks/useAtiveWorkspaceChangedToast';
import { useClipboardText } from '../hooks/useClipboardText';
@@ -86,7 +86,7 @@ export function GlobalHooks() {
return;
}
if (model.model === 'http_request' && windowLabel !== getCurrent().label) {
if (model.model === 'http_request' && windowLabel !== getCurrentWebviewWindow().label) {
wasUpdatedExternally(model.id);
}
@@ -142,7 +142,7 @@ export function GlobalHooks() {
}
const { interfaceScale, interfaceFontSize, editorFontSize } = settings;
getCurrent().setZoom(interfaceScale).catch(console.error);
getCurrentWebviewWindow().setZoom(interfaceScale).catch(console.error);
document.documentElement.style.setProperty('font-size', `${interfaceFontSize}px`);
document.documentElement.style.setProperty('--editor-font-size', `${editorFontSize}px`);
}, [settings]);

View File

@@ -1,4 +1,4 @@
import { getCurrent } from '@tauri-apps/api/webviewWindow';
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import classNames from 'classnames';
import React from 'react';
import { useKeyPressEvent, useLocalStorage } from 'react-use';
@@ -24,7 +24,7 @@ export const Settings = () => {
// Close settings window on escape
// TODO: Could this be put in a better place? Eg. in Rust key listener when creating the window
useKeyPressEvent('Escape', () => getCurrent().close());
useKeyPressEvent('Escape', () => getCurrentWebviewWindow().close());
return (
<div className={classNames('grid grid-rows-[auto_minmax(0,1fr)] h-full')}>

View File

@@ -1,4 +1,4 @@
import { getCurrent } from '@tauri-apps/api/webviewWindow';
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import classNames from 'classnames';
import React, { useState } from 'react';
import { useOsInfo } from '../hooks/useOsInfo';
@@ -25,7 +25,7 @@ export function WindowControls({ className, onlyX }: Props) {
<Button
className="!h-full px-4 text-fg-subtle hocus:text-fg hocus:bg-background-highlight-secondary rounded-none"
color="custom"
onClick={() => getCurrent().minimize()}
onClick={() => getCurrentWebviewWindow().minimize()}
>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="currentColor" d="M14 8v1H3V8z" />
@@ -35,7 +35,7 @@ export function WindowControls({ className, onlyX }: Props) {
className="!h-full px-4 text-fg-subtle hocus:text-fg hocus:bg-background-highlight rounded-none"
color="custom"
onClick={async () => {
const w = getCurrent();
const w = getCurrentWebviewWindow();
await w.toggleMaximize();
setMaximized(await w.isMaximized());
}}
@@ -58,7 +58,7 @@ export function WindowControls({ className, onlyX }: Props) {
<Button
color="custom"
className="!h-full px-4 text-fg-subtle rounded-none hocus:bg-fg-danger hocus:text-fg"
onClick={() => getCurrent().close()}
onClick={() => getCurrentWebviewWindow().close()}
>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path