Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,28 @@ fn main() {
.setup(backend::initialize)
.invoke_handler(tauri::generate_handler![
show_folder_in_finder,
show_main_window,
backend::get_last_log_file,
])
.run(tauri::generate_context!())
.expect("error running tauri application");
}

#[tauri::command]
fn show_main_window(app_handle: tauri::AppHandle) {
match app_handle.get_window("main") {
Some(window) => {
if !cfg!(target_os = "macos") {
window.unminimize().unwrap();
}
window.unminimize().unwrap();
window.set_focus().unwrap();
window.show().unwrap();
}
None => {}
}
}

#[tauri::command]
fn show_folder_in_finder(path: String) {
let path = PathBuf::from(path).canonicalize().unwrap();
Expand Down
4 changes: 3 additions & 1 deletion client/src/pages/Onboarding/Desktop/UserForm/Step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const UserFormStep2 = ({ onContinue }: Props) => {
const { isGithubConnected, setGithubConnected } = useContext(
UIContext.GitHubConnected,
);
const { envConfig, openLink, setEnvConfig } = useContext(DeviceContext);
const { envConfig, openLink, setEnvConfig, invokeTauriCommand } =
useContext(DeviceContext);
const [isTimedOut, setIsTimedOut] = useState(false);
const [isBtnClicked, setBtnClicked] = useState(false);
const [loginUrl, setLoginUrl] = useState('');
Expand Down Expand Up @@ -84,6 +85,7 @@ const UserFormStep2 = ({ onContinue }: Props) => {
() =>
checkGHAuth().then((d) => {
if (!!d.user_login) {
invokeTauriCommand('show_main_window');
onContinue();
}
}),
Expand Down