addressed feedback

This commit is contained in:
MrStashley 2024-03-13 16:32:19 -07:00
parent 8884d5f6d3
commit 3490dcbedb
5 changed files with 7 additions and 6 deletions

View File

@ -512,7 +512,7 @@ electron.ipcMain.on("toggle-developer-tools", (event) => {
event.returnValue = true; event.returnValue = true;
}); });
electron.ipcMain.on("minimize-window", (event) => { electron.ipcMain.on("hide-window", (event) => {
if (MainWindow != null) { if (MainWindow != null) {
MainWindow.hide(); MainWindow.hide();
} }

View File

@ -1,7 +1,7 @@
let { contextBridge, ipcRenderer } = require("electron"); let { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("api", { contextBridge.exposeInMainWorld("api", {
minimizeWindow: () => ipc.Renderer.send("minimize-window"), hideWindow: () => ipc.Renderer.send("hide-window"),
toggleDeveloperTools: () => ipcRenderer.send("toggle-developer-tools"), toggleDeveloperTools: () => ipcRenderer.send("toggle-developer-tools"),
getId: () => ipcRenderer.sendSync("get-id"), getId: () => ipcRenderer.sendSync("get-id"),
getPlatform: () => ipcRenderer.sendSync("get-platform"), getPlatform: () => ipcRenderer.sendSync("get-platform"),

View File

@ -223,7 +223,7 @@ class Model {
return true; return true;
}); });
this.keybindManager.registerKeybinding("system", "electron", "system:minimizeWindow", (waveEvent) => { this.keybindManager.registerKeybinding("system", "electron", "system:minimizeWindow", (waveEvent) => {
getApi().minimizeWindow(); getApi().hideWindow();
return true; return true;
}); });
} }

View File

@ -880,7 +880,7 @@ declare global {
}; };
type ElectronApi = { type ElectronApi = {
minimizeWindow: () => void; hideWindow: () => void;
toggleDeveloperTools: () => void; toggleDeveloperTools: () => void;
getId: () => string; getId: () => string;
getIsDev: () => boolean; getIsDev: () => boolean;

View File

@ -3564,6 +3564,7 @@ func SessionSetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (s
} }
func SleepCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) { func SleepCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) {
sleepTimeLimit := 10000
if len(pk.Args) < 1 { if len(pk.Args) < 1 {
return nil, fmt.Errorf("no argument found - usage: /sleep [ms]") 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 { if err != nil {
return nil, fmt.Errorf("couldn't parse sleep arg: %v", err) return nil, fmt.Errorf("couldn't parse sleep arg: %v", err)
} }
if sleepArgInt > 10000 { if sleepArgInt > sleepTimeLimit {
return nil, fmt.Errorf("sleep arg is too long, max value is 1000") return nil, fmt.Errorf("sleep arg is too long, max value is %v", sleepTimeLimit)
} }
time.Sleep(time.Duration(sleepArgInt) * time.Millisecond) time.Sleep(time.Duration(sleepArgInt) * time.Millisecond)
update := scbus.MakeUpdatePacket() update := scbus.MakeUpdatePacket()