Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#149 reload only the profile that is selected #150

Merged
merged 1 commit into from
May 7, 2024
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
2 changes: 1 addition & 1 deletion src-tauri/src/app/handles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ fn get_session_and_server(app: &tauri::AppHandle) -> (String, ServerProps) {
async fn refresh_profile(app: &tauri::AppHandle) {
let (session_id, server_props) = get_session_and_server(app);
let _ = refresh_profile_on_server(&server_props, &session_id).await;
app.emit_all("profile_loaded", "")
app.emit_all("profile_loaded", session_id)
.expect("Can't emit event to window!");
}

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/app/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn handle_menu_event(event: WindowMenuEvent) {
}
if internal_state.session_id.is_some() {
window
.emit("profile_loaded", "")
.emit("profile_loaded", &internal_state.session_id)
.expect("Can't emit event to window!");
}

Expand Down
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
$: isLoading = $loading;
$: sessions = [];

listen('profile_loaded', () => {
if (selectedSession) {
listen('profile_loaded', (event) => {
if (selectedSession && selectedSession.id === event.payload) {
reloadProfile(selectedSession);
}
});
Expand Down
Loading