Fix new window from menu bar (#91)

Fixes the New Window menu item so that it shows the new window after it
loads and captures any errors that occur. Also adds a keyboard shortcut
for new window and uses the native shortcut for close window.
This commit is contained in:
Evan Simkowitz
2024-06-28 16:24:40 -07:00
committed by GitHub
parent 4c45bca56b
commit 50a4074c39
2 changed files with 18 additions and 5 deletions
+11 -1
View File
@@ -89,4 +89,14 @@ function makeIconClass(icon: string, fw: boolean): string {
return null;
}
export { base64ToArray, base64ToString, isBlank, jsonDeepEqual, makeIconClass, stringToBase64 };
/**
* A wrapper function for running a promise and catching any errors
* @param f The promise to run
*/
function fireAndForget(f: () => Promise<any>) {
f().catch((e) => {
console.log("fireAndForget error", e);
});
}
export { base64ToArray, base64ToString, fireAndForget, isBlank, jsonDeepEqual, makeIconClass, stringToBase64 };