mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
Fix invoke calls in dialog & shell init scripts (#675)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
@@ -3,19 +3,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { invoke } from "@tauri-apps/api/primitives";
|
||||
|
||||
interface WindowDef {
|
||||
label: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI_METADATA__: {
|
||||
__windows: WindowDef[];
|
||||
__currentWindow: WindowDef;
|
||||
};
|
||||
}
|
||||
}
|
||||
import { getCurrent } from "@tauri-apps/api/window";
|
||||
|
||||
export enum StateFlags {
|
||||
SIZE = 1 << 0,
|
||||
@@ -50,7 +38,7 @@ async function restoreState(label: string, flags: StateFlags): Promise<void> {
|
||||
* Restore the state for the current window from disk.
|
||||
*/
|
||||
async function restoreStateCurrent(flags: StateFlags): Promise<void> {
|
||||
return restoreState(window.__TAURI_METADATA__.__currentWindow.label, flags);
|
||||
return restoreState(getCurrent().label, flags);
|
||||
}
|
||||
|
||||
export { restoreState, restoreStateCurrent, saveWindowState };
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user