diff --git a/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx b/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx
index 59a4538ed..95b9f7144 100644
--- a/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx
+++ b/apps/desktop/layer/renderer/src/modules/discover/FeedForm.tsx
@@ -117,7 +117,7 @@ export const FeedForm: Component<{
isError: feedQuery.isError,
})
}
- }, [feedQuery.isLoading])
+ }, [feedQuery.data?.feed.url, feedQuery.isError, feedQuery.isLoading, id, url])
return (
{
setClickOutSideToDismiss(!form.formState.isDirty)
- }, [form.formState.isDirty])
+ }, [form.formState.isDirty, setClickOutSideToDismiss])
useEffect(() => {
if (subscription) {
@@ -262,7 +262,7 @@ const FeedInnerForm = ({
form.setValue("hideFromTimeline", subscription.hideFromTimeline)
subscription?.title && form.setValue("title", subscription.title)
}
- }, [subscription])
+ }, [form, subscription])
useEffect(() => {
if (
@@ -272,7 +272,7 @@ const FeedInnerForm = ({
) {
form.setValue("view", `${analytics.view}`)
}
- }, [analytics, subscription, defaultValues?.view])
+ }, [analytics, defaultValues?.view, form, subscription])
const followMutation = useMutation({
mutationFn: async (values: z.infer) => {
diff --git a/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx b/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx
index 6fee1262d..cd69cc835 100644
--- a/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx
+++ b/apps/desktop/layer/renderer/src/modules/power/my-wallet-section/withdraw.tsx
@@ -31,6 +31,8 @@ import { useTOTPModalWrapper } from "~/modules/profile/hooks"
import { Balance } from "~/modules/wallet/balance"
import { useWallet, wallet as walletActions } from "~/queries/wallet"
+const RSS3_CONVERSION_RATE = 0.043
+
export const WithdrawButton = () => {
const { t } = useTranslation("settings")
const { present } = useModalStack()
@@ -54,18 +56,22 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
const wallet = useWallet()
const cashablePowerTokenBigInt = [BigInt(wallet.data?.[0]!.cashablePowerToken || 0n), 18] as const
const cashablePowerTokenNumber = toNumber(cashablePowerTokenBigInt)
+ const walletAddress = wallet.data?.[0]?.address ?? "-"
const formSchema = z.object({
address: z.string().startsWith("0x").length(42),
amount: z.number().positive().max(cashablePowerTokenNumber),
- toRss3: z.boolean().optional(),
+ toRss3: z.boolean(),
})
const form = useForm>({
resolver: zodResolver(formSchema),
+ defaultValues: {
+ toRss3: true,
+ },
})
-
- const rss3ConversionRate: number | null = null
+ const withdrawAmount = form.watch("amount")
+ const receiveAmount = Number.isFinite(withdrawAmount) ? withdrawAmount * RSS3_CONVERSION_RATE : 0
const mutation = useMutation({
mutationFn: async ({
@@ -91,7 +97,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
const present = useTOTPModalWrapper(mutation.mutateAsync, { force: true })
const onSubmit = (values: z.infer) => {
- present(values)
+ present({ ...values, toRss3: true })
}
useEffect(() => {
@@ -126,6 +132,9 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {