Skip to content

Commit

Permalink
[FIX]: set initial state properly for password modal (#3482)
Browse files Browse the repository at this point in the history
fix: set initial state properly for password modal
  • Loading branch information
imLinguin authored Feb 6, 2024
1 parent faa3ea6 commit 4c8ae63
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { SelectField, TextInputField } from 'frontend/components/UI'
import { useTranslation } from 'react-i18next'
import { Dialog, DialogContent } from 'frontend/components/UI/Dialog'
Expand All @@ -25,7 +25,12 @@ export default function BranchSelector({

const [showBranchPasswordInput, setShowBranchPasswordInput] =
useState<boolean>(false)
const [branchPassword, setBranchPassword] = useState<string>('')
const [branchPassword, setBranchPassword] =
useState<string>(savedBranchPassword)

useEffect(() => {
setBranchPassword(savedBranchPassword)
}, [savedBranchPassword])

return (
<div>
Expand Down

0 comments on commit 4c8ae63

Please sign in to comment.