21 lines
842 B
TypeScript
21 lines
842 B
TypeScript
import * as main_window from "./main_window";
|
|
|
|
export function handle_second_instance_call(argv: string[], work_dir: string) {
|
|
const original_args = argv.slice(1).filter(e => !e.startsWith("--original-process-start-time=") && e != "--allow-file-access-from-files");
|
|
console.log("Second instance: %o", original_args);
|
|
|
|
if(!main_window.main_window) {
|
|
console.warn("Ignoring second instance call because we haven't yet started");
|
|
return;
|
|
}
|
|
main_window.main_window.focus();
|
|
execute_connect_urls(original_args);
|
|
}
|
|
|
|
export function execute_connect_urls(argv: string[]) {
|
|
const connect_urls = argv.filter(e => e.startsWith("teaclient://"));
|
|
for(const url of connect_urls) {
|
|
console.log("Received connect url: %s", url);
|
|
main_window.main_window.webContents.send('connect', url);
|
|
}
|
|
} |