private async Task selectProject() { if (!(Workspace.Value?.Id is long workspaceId)) { return; } var chosenProjectParams = await Navigate <SelectProjectViewModel, SelectProjectParameter, SelectProjectParameter>( new SelectProjectParameter(Project.Value?.Id, TaskId.Value, workspaceId, false)); if (chosenProjectParams.WorkspaceId == workspaceId && chosenProjectParams.ProjectId == Project.Value?.Id && chosenProjectParams.TaskId == TaskId.Value) { return; } TaskId.Accept(chosenProjectParams.TaskId); var chosenWorkspace = await interactorFactory.GetWorkspaceById(chosenProjectParams.WorkspaceId).Execute(); if (!(chosenProjectParams.ProjectId is long chosenProjectProjectId)) { projectClientTaskInfo.OnNext(EditTimeEntryViewModel.ProjectClientTaskInfo.Empty); clearTagsIfNeeded(workspaceId, chosenProjectParams.WorkspaceId); Workspace.Accept(chosenWorkspace); Project.Accept(null); return; } var project = await interactorFactory.GetProjectById(chosenProjectProjectId).Execute(); clearTagsIfNeeded(workspaceId, project.WorkspaceId); var task = chosenProjectParams.TaskId.HasValue ? await interactorFactory.GetTaskById(chosenProjectParams.TaskId.Value).Execute() : null; var taskName = task?.Name ?? string.Empty; projectClientTaskInfo.OnNext(new EditTimeEntryViewModel.ProjectClientTaskInfo( project.DisplayName(), project.DisplayColor(), project.Client?.Name, taskName, project.IsPlaceholder(), task?.IsPlaceholder() ?? false)); Workspace.Accept(chosenWorkspace); Project.Accept(project); }