chore: Update shareMode default value to false

This commit is contained in:
n4ze3m
2024-05-14 12:44:37 +05:30
parent 8f8fac826e
commit 3170bc4be6
4 changed files with 19 additions and 6 deletions

View File

@@ -11,7 +11,10 @@ import { useStorage } from "@plasmohq/storage/hook"
export const OptionShareBody = () => {
const queryClient = useQueryClient()
const { t } = useTranslation(["settings"])
const [shareModeEnabled, setShareModelEnabled] = useStorage("shareMode", true)
const [shareModeEnabled, setShareModelEnabled] = useStorage(
"shareMode",
false
)
const { status, data } = useQuery({
queryKey: ["fetchShareInfo"],
@@ -25,8 +28,12 @@ export const OptionShareBody = () => {
})
const onSubmit = async (values: { url: string }) => {
const isOk = await verifyPageShareURL(values.url)
if (isOk) {
if (shareModeEnabled) {
const isOk = await verifyPageShareURL(values.url)
if (isOk) {
await setPageShareUrl(values.url)
}
} else {
await setPageShareUrl(values.url)
}
}