mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
addressed feedback
This commit is contained in:
parent
8884d5f6d3
commit
3490dcbedb
@ -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();
|
||||
}
|
||||
|
@ -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"),
|
||||
|
@ -223,7 +223,7 @@ class Model {
|
||||
return true;
|
||||
});
|
||||
this.keybindManager.registerKeybinding("system", "electron", "system:minimizeWindow", (waveEvent) => {
|
||||
getApi().minimizeWindow();
|
||||
getApi().hideWindow();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
2
src/types/custom.d.ts
vendored
2
src/types/custom.d.ts
vendored
@ -880,7 +880,7 @@ declare global {
|
||||
};
|
||||
|
||||
type ElectronApi = {
|
||||
minimizeWindow: () => void;
|
||||
hideWindow: () => void;
|
||||
toggleDeveloperTools: () => void;
|
||||
getId: () => string;
|
||||
getIsDev: () => boolean;
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user