commit
02474c80c4
|
|
@ -164,7 +164,7 @@ impl From<Vec<AFWorkspace>> for AFWorkspaces {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AFWorkspaces {
|
impl AFWorkspaces {
|
||||||
pub fn get_latest(&self, profile: AFUserProfileView) -> Option<AFWorkspace> {
|
pub fn get_latest(&self, profile: &AFUserProfileView) -> Option<AFWorkspace> {
|
||||||
match profile.latest_workspace_id {
|
match profile.latest_workspace_id {
|
||||||
Some(ws_id) => self.0.iter().find(|ws| ws.workspace_id == ws_id).cloned(),
|
Some(ws_id) => self.0.iter().find(|ws| ws.workspace_id == ws_id).cloned(),
|
||||||
None => None,
|
None => None,
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ async fn sign_in_success() {
|
||||||
let workspaces = c.workspaces().await.unwrap();
|
let workspaces = c.workspaces().await.unwrap();
|
||||||
assert!(!workspaces.0.is_empty());
|
assert!(!workspaces.0.is_empty());
|
||||||
let profile = c.profile().await.unwrap();
|
let profile = c.profile().await.unwrap();
|
||||||
let latest_workspace = workspaces.get_latest(profile);
|
let latest_workspace = workspaces.get_latest(&profile);
|
||||||
assert!(latest_workspace.is_some());
|
assert!(latest_workspace.is_some());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue