diff --git a/src/electron/emain.ts b/src/electron/emain.ts index 9779a5ddd..2c72bfeed 100644 --- a/src/electron/emain.ts +++ b/src/electron/emain.ts @@ -512,7 +512,7 @@ electron.ipcMain.on("toggle-developer-tools", (event) => { event.returnValue = true; }); -electron.ipcMain.on("minimize-window", (event) => { +electron.ipcMain.on("hide-window", (event) => { if (MainWindow != null) { MainWindow.hide(); } diff --git a/src/electron/preload.js b/src/electron/preload.js index 1da2ace82..1b5f1a637 100644 --- a/src/electron/preload.js +++ b/src/electron/preload.js @@ -1,7 +1,7 @@ let { contextBridge, ipcRenderer } = require("electron"); contextBridge.exposeInMainWorld("api", { - minimizeWindow: () => ipc.Renderer.send("minimize-window"), + hideWindow: () => ipc.Renderer.send("hide-window"), toggleDeveloperTools: () => ipcRenderer.send("toggle-developer-tools"), getId: () => ipcRenderer.sendSync("get-id"), getPlatform: () => ipcRenderer.sendSync("get-platform"), diff --git a/src/models/model.ts b/src/models/model.ts index 6bc214977..11a93a203 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -223,7 +223,7 @@ class Model { return true; }); this.keybindManager.registerKeybinding("system", "electron", "system:minimizeWindow", (waveEvent) => { - getApi().minimizeWindow(); + getApi().hideWindow(); return true; }); } diff --git a/src/types/custom.d.ts b/src/types/custom.d.ts index c682b3b10..08e424ce7 100644 --- a/src/types/custom.d.ts +++ b/src/types/custom.d.ts @@ -880,7 +880,7 @@ declare global { }; type ElectronApi = { - minimizeWindow: () => void; + hideWindow: () => void; toggleDeveloperTools: () => void; getId: () => string; getIsDev: () => boolean; diff --git a/wavesrv/pkg/cmdrunner/cmdrunner.go b/wavesrv/pkg/cmdrunner/cmdrunner.go index 4f79437db..0d674efb7 100644 --- a/wavesrv/pkg/cmdrunner/cmdrunner.go +++ b/wavesrv/pkg/cmdrunner/cmdrunner.go @@ -3564,6 +3564,7 @@ func SessionSetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (s } func SleepCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) { + sleepTimeLimit := 10000 if len(pk.Args) < 1 { return nil, fmt.Errorf("no argument found - usage: /sleep [ms]") } @@ -3572,8 +3573,8 @@ func SleepCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus. if err != nil { return nil, fmt.Errorf("couldn't parse sleep arg: %v", err) } - if sleepArgInt > 10000 { - return nil, fmt.Errorf("sleep arg is too long, max value is 1000") + if sleepArgInt > sleepTimeLimit { + return nil, fmt.Errorf("sleep arg is too long, max value is %v", sleepTimeLimit) } time.Sleep(time.Duration(sleepArgInt) * time.Millisecond) update := scbus.MakeUpdatePacket()