move app state to store
This commit is contained in:
@ -2,11 +2,10 @@
|
||||
import { invoke } from '@tauri-apps/api/tauri';
|
||||
|
||||
import { navigate } from '../lib/routing.js';
|
||||
import { appState } from '../lib/state.js';
|
||||
import Link from '../ui/Link.svelte';
|
||||
import Icon from '../ui/Icon.svelte';
|
||||
|
||||
export let appState;
|
||||
|
||||
|
||||
async function approve() {
|
||||
let status = await invoke('get_session_status');
|
||||
@ -22,8 +21,8 @@
|
||||
}
|
||||
|
||||
var appName = null;
|
||||
if (appState.currentRequest.clients.length === 1) {
|
||||
let path = appState.currentRequest.clients[0].exe;
|
||||
if ($appState.currentRequest.clients.length === 1) {
|
||||
let path = $appState.currentRequest.clients[0].exe;
|
||||
let m = path.match(/\/([^/]+?$)|\\([^\\]+?$)/);
|
||||
appName = m[1] || m[2];
|
||||
}
|
||||
@ -34,7 +33,7 @@
|
||||
<!-- <div class="p-4 rounded-box border-2 border-neutral-content"> -->
|
||||
<div class="space-y-1 mb-4">
|
||||
<h2 class="text-xl font-bold">{appName ? `"${appName}"` : 'An appplication'} would like to access your AWS credentials.</h2>
|
||||
{#each appState.currentRequest.clients as client}
|
||||
{#each $appState.currentRequest.clients as client}
|
||||
<p>Path: {client ? client.exe : 'Unknown'}</p>
|
||||
<p>PID: {client ? client.pid : 'Unknown'}</p>
|
||||
{/each}
|
||||
|
Reference in New Issue
Block a user