From fb3b00de410987bed52c1bafa81fefdeb0bae59e Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:17:27 +1300 Subject: [PATCH] fix(UI): remember backup settings tab selection [EE-6347] (#10765) * remember backup settings tab selection * address review comments --- .../BackupSettingsView/BackupSettingsPanel.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx index 107e6b6e6..225507005 100644 --- a/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx +++ b/app/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel.tsx @@ -1,5 +1,6 @@ import { Download } from 'lucide-react'; -import { useState } from 'react'; + +import { useLocalStorage } from '@/react/hooks/useLocalStorage'; import { Widget, WidgetBody, WidgetTitle } from '@@/Widget'; import { FormSection } from '@@/form-components/FormSection'; @@ -10,7 +11,10 @@ import { BackupFileForm } from './BackupFileForm'; import { BackupS3Form } from './BackupS3Form'; export function BackupSettingsPanel() { - const [backupType, setBackupType] = useState(options[0].value); + const [backupType, setBackupType] = useLocalStorage( + 'settings_backup_type', + options[0].value + ); return (