Implement adaptive Android shell and safe navigation (#102)
This commit is contained in:
1 parent
c7703d8efd
commit
d22d71eb5e
32 files changed
+2194
-104
No files matched your search
@@ -189,6 +189,7 @@ pub enum MobileShellState {
|
||||
Ready,
|
||||
Locked,
|
||||
Error,
|
||||
Stale,
|
||||
}
|
||||
|
||||
impl From<StorageShellState> for MobileShellState {
|
||||
@@ -199,6 +200,7 @@ impl From<StorageShellState> for MobileShellState {
|
||||
StorageShellState::Ready => Self::Ready,
|
||||
StorageShellState::Locked => Self::Locked,
|
||||
StorageShellState::Error => Self::Error,
|
||||
StorageShellState::Stale => Self::Stale,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,6 +213,7 @@ impl From<MobileShellState> for StorageShellState {
|
||||
MobileShellState::Ready => Self::Ready,
|
||||
MobileShellState::Locked => Self::Locked,
|
||||
MobileShellState::Error => Self::Error,
|
||||
MobileShellState::Stale => Self::Stale,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2520,6 +2523,7 @@ mod tests {
|
||||
MobileShellState::Ready,
|
||||
MobileShellState::Locked,
|
||||
MobileShellState::Error,
|
||||
MobileShellState::Stale,
|
||||
] {
|
||||
let shell = super::mobile_shell_fixture(state);
|
||||
assert_eq!(shell.selected_tab, MobileTab::Home);
|
||||
|
||||
@@ -105,6 +105,7 @@ pub enum MobileShellState {
|
||||
Ready,
|
||||
Locked,
|
||||
Error,
|
||||
Stale,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
@@ -250,6 +251,10 @@ fn state_copy(tab: MobileTab, state: MobileShellState, error: Option<&str>) -> (
|
||||
"IronStorage is Locked".to_owned(),
|
||||
"Authenticate to reveal protected content.".to_owned(),
|
||||
),
|
||||
MobileShellState::Stale => (
|
||||
"Password Store Changed".to_owned(),
|
||||
"Refresh to load the current repository state.".to_owned(),
|
||||
),
|
||||
MobileShellState::Error => (
|
||||
"IronStorage Is Unavailable".to_owned(),
|
||||
error
|
||||
@@ -275,6 +280,7 @@ mod tests {
|
||||
MobileShellState::Ready,
|
||||
MobileShellState::Locked,
|
||||
MobileShellState::Error,
|
||||
MobileShellState::Stale,
|
||||
] {
|
||||
let shell = MobileShell::fixture(state);
|
||||
assert_eq!(shell.selected_tab(), MobileTab::Home);
|
||||
|
||||
Reference in new issue
Block a user