return to previous view after approval flow

This commit is contained in:
2023-05-01 13:27:28 -07:00
parent 886fcd9bb8
commit a75f34865e
9 changed files with 70 additions and 91 deletions

View File

@ -8,9 +8,10 @@
async function approve() {
$appState.currentRequest.approval = 'Approved';
let status = await invoke('get_session_status');
if (status === 'unlocked') {
navigate('ShowApproved');
navigate('ShowResponse');
}
else if (status === 'locked') {
navigate('Unlock');
@ -20,9 +21,15 @@
}
}
var appName = null;
function deny() {
$appState.currentRequest.approval = 'Denied';
navigate('ShowResponse');
}
let appName = null;
if ($appState.currentRequest.clients.length === 1) {
let path = $appState.currentRequest.clients[0].exe;
// grab the filename from the path
let m = path.match(/\/([^/]+?$)|\\([^\\]+?$)/);
appName = m[1] || m[2];
}
@ -40,7 +47,7 @@
</div>
<div class="grid grid-cols-2">
<Link target="ShowDenied" hotkey="Escape">
<Link target="{deny}" hotkey="Escape">
<button class="btn btn-error justify-self-start">
Deny
<kbd class="ml-2 normal-case px-1 py-0.5 rounded border border-neutral">Esc</kbd>