(fullConfig: FullConfigType)
| 42 | const WaveHomeVarName = "WAVETERM_HOME"; |
| 43 | |
| 44 | export function checkIfRunningUnderARM64Translation(fullConfig: FullConfigType) { |
| 45 | if (!fullConfig.settings["app:dismissarchitecturewarning"] && app.runningUnderARM64Translation) { |
| 46 | console.log("Running under ARM64 translation, alerting user"); |
| 47 | const dialogOpts: Electron.MessageBoxOptions = { |
| 48 | type: "warning", |
| 49 | buttons: ["Dismiss", "Learn More"], |
| 50 | title: "Wave has detected a performance issue", |
| 51 | message: `Wave is running in ARM64 translation mode which may impact performance.\n\nRecommendation: Download the native ARM64 version from our website for optimal performance.`, |
| 52 | }; |
| 53 | |
| 54 | const choice = dialog.showMessageBoxSync(null, dialogOpts); |
| 55 | if (choice === 1) { |
| 56 | // Open the documentation URL |
| 57 | console.log("User chose to learn more"); |
| 58 | fireAndForget(() => |
| 59 | shell.openExternal( |
| 60 | "https://docs.waveterm.dev/faq#why-does-wave-warn-me-about-arm64-translation-when-it-launches" |
| 61 | ) |
| 62 | ); |
| 63 | throw new Error("User redirected to docsite to learn more about ARM64 translation, exiting"); |
| 64 | } else { |
| 65 | console.log("User dismissed the dialog"); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Gets the path to the old Wave home directory (defaults to `~/.waveterm`). |
no test coverage detected