[Update] update tauri v1-> v2 (development)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from "@tauri-apps/api/window";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
|
||||
import {
|
||||
useStore_TranslationStatus,
|
||||
@@ -75,8 +75,8 @@ export const useMainFunction = () => {
|
||||
};
|
||||
|
||||
|
||||
const toggleForeground = () => {
|
||||
const main_page = getCurrent();
|
||||
const toggleForeground = async () => {
|
||||
const main_page = await getCurrentWindow();
|
||||
const is_foreground_enabled = !currentForegroundStatus.data;
|
||||
main_page.setAlwaysOnTop(is_foreground_enabled);
|
||||
updateForegroundStatus(is_foreground_enabled);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { useStore_MessageInputBoxRatio } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { clampMinMax } from "@utils";
|
||||
export const useMessageInputBoxRatio = () => {
|
||||
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentMessageInputBoxRatio, updateMessageInputBoxRatio } = useStore_MessageInputBoxRatio();
|
||||
|
||||
@@ -11,6 +12,7 @@ export const useMessageInputBoxRatio = () => {
|
||||
};
|
||||
|
||||
const asyncSetMessageInputBoxRatio = async (ratio) => {
|
||||
const appWindow = getCurrentWindow();
|
||||
const minimized = await appWindow.isMinimized();
|
||||
if (minimized === true) return; // don't save while the window is minimized.
|
||||
const parsed = parseFloat(ratio.toFixed(2));
|
||||
|
||||
Reference in New Issue
Block a user