-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(staking): clicking on drift warning not working (popup) LW-9438 (#…
…918) * fix(staking): clicking on drift warning not working (popup) LW-9438
- Loading branch information
1 parent
90c4177
commit 3fbb664
Showing
10 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useSearchParams } from '@lace/common'; | ||
import { useDelegationPortfolioStore } from 'features/store'; | ||
import { useCallback, useState } from 'react'; | ||
|
||
export const useStakingSectionLoadActions = () => { | ||
const portfolioMutators = useDelegationPortfolioStore((store) => store.mutators); | ||
const { onLoadAction } = useSearchParams(['onLoadAction']); | ||
const [executed, setExecuted] = useState(false); | ||
|
||
const onLoad = useCallback(() => { | ||
if (!executed && onLoadAction === 'ManagePortfolio') { | ||
portfolioMutators.executeCommand({ | ||
type: 'ManagePortfolio', | ||
}); | ||
setExecuted(true); | ||
} | ||
}, [executed, onLoadAction, portfolioMutators]); | ||
|
||
return { | ||
onLoad, | ||
}; | ||
}; |