refactor: cleanup and minor improvements
- Remove unused useDarkMode hook (now using shadcn theme-provider) - Clean up MCP components (remove redundant code) - Add restart API to settings - Minor type improvements
This commit is contained in:
@@ -98,6 +98,15 @@ export const settingsApi = {
|
||||
},
|
||||
|
||||
async openExternal(url: string): Promise<void> {
|
||||
try {
|
||||
const u = new URL(url);
|
||||
const scheme = u.protocol.replace(":", "").toLowerCase();
|
||||
if (scheme !== "http" && scheme !== "https") {
|
||||
throw new Error("Unsupported URL scheme");
|
||||
}
|
||||
} catch {
|
||||
throw new Error("Invalid URL");
|
||||
}
|
||||
await invoke("open_external", { url });
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user