mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
initial implementation for password saving (#132)
* initial implementation for password saving * support restoring password in interceptor * Fix modal overflow and position styles * warn about 429, better error handling --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com> Co-authored-by: Jeff <42182408+jeffvli@users.noreply.github.com>
This commit is contained in:
parent
a3a84766e4
commit
2fac9efc1b
13 changed files with 310 additions and 62 deletions
|
|
@ -31,6 +31,7 @@ import { ServerListItem, ServerType } from '/@/renderer/types';
|
|||
import packageJson from '../../../../../package.json';
|
||||
|
||||
const browser = isElectron() ? window.electron.browser : null;
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
|
||||
export const AppMenu = () => {
|
||||
const navigate = useNavigate();
|
||||
|
|
@ -45,11 +46,21 @@ export const AppMenu = () => {
|
|||
setCurrentServer(server);
|
||||
};
|
||||
|
||||
const handleCredentialsModal = (server: ServerListItem) => {
|
||||
const handleCredentialsModal = async (server: ServerListItem) => {
|
||||
let password: string | undefined;
|
||||
|
||||
try {
|
||||
if (localSettings && server.savePassword) {
|
||||
password = await localSettings.passwordGet(server.id);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
openModal({
|
||||
children: server && (
|
||||
<EditServerForm
|
||||
isUpdate
|
||||
password={password}
|
||||
server={server}
|
||||
onCancel={closeAllModals}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue