return to Approve screen after cancelling unlock during request approval

This commit is contained in:
Joseph Montanaro 2024-02-07 13:03:12 -08:00
parent 87617a0726
commit 64a2927b94
8 changed files with 14 additions and 13 deletions

View File

@ -21,3 +21,4 @@
* Make hotkey configuration a little more tolerant of slight mistiming
* Distinguish between request that was denied and request that was canceled (e.g. due to error)
* Use atomic types for primitive state values instead of RwLock'd types
* Rework approval flow to be a fullscreen overlay instead of mixing with normal navigation (as more views are added the pain of the current situation will only increase)

View File

@ -1,6 +1,6 @@
{
"name": "creddy",
"version": "0.4.6",
"version": "0.4.7",
"scripts": {
"dev": "vite",
"build": "vite build",

View File

@ -1,6 +1,6 @@
[package]
name = "creddy"
version = "0.4.6"
version = "0.4.7"
description = "A friendly AWS credentials manager"
authors = ["Joseph Montanaro"]
license = ""

View File

@ -223,7 +223,7 @@ pub enum GetSessionError {
EmptyResponse, // SDK returned successfully but credentials are None
#[error("Error response from AWS SDK: {0}")]
SdkError(#[from] AwsSdkError<GetSessionTokenError>),
#[error("Could not construt session: credentials are locked")]
#[error("Could not construct session: credentials are locked")]
CredentialsLocked,
#[error("Could not construct session: no credentials are known")]
CredentialsEmpty,

View File

@ -8,7 +8,7 @@
},
"package": {
"productName": "creddy",
"version": "0.4.6"
"version": "0.4.7"
},
"tauri": {
"allowlist": {

View File

@ -22,7 +22,7 @@ listen('credentials-request', (tauriEvent) => {
listen('request-cancelled', (tauriEvent) => {
const id = tauriEvent.payload;
if (id === $appState.currentRequest?.id) {
cleanupRequest()
cleanupRequest();
}
else {
const found = $appState.pendingRequests.find_remove(r => r.id === id);

View File

@ -43,13 +43,6 @@
}
}
function approve_base() {
approve(true);
}
function approve_session() {
approve(false);
}
// Denial has only one
async function deny() {
$appState.currentRequest.response = {approval: 'Denied', base: false};

View File

@ -55,7 +55,14 @@
function cancel() {
emit('credentials-event', 'unlock-canceled');
navigate('Home');
if ($appState.currentRequest !== null) {
// dirty hack to prevent spurious error when returning to approve screen
delete $appState.currentRequest.response;
navigate('Approve');
}
else {
navigate('Home');
}
}
onMount(() => {