mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-06 12:19:50 +00:00
fix toggle on pin or passcode not working on policy form
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, useContext, useState } from "react";
|
||||
import { createContext, useContext, useEffect, useState } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import type { GetResourcePolicyResponse } from "@server/routers/policy";
|
||||
|
||||
@@ -16,6 +16,10 @@ export function ResourcePolicyProvider({
|
||||
const [policy, setPolicy] =
|
||||
useState<GetResourcePolicyResponse>(serverPolicy);
|
||||
|
||||
useEffect(() => {
|
||||
setPolicy(serverPolicy);
|
||||
}, [serverPolicy]);
|
||||
|
||||
const t = useTranslations();
|
||||
|
||||
const updatePolicy = (
|
||||
|
||||
Reference in New Issue
Block a user