From 6c304bcc5fe715cae2dff71d24e672b4464910bd Mon Sep 17 00:00:00 2001 From: Rohid Date: Sat, 17 Aug 2024 16:29:33 +0600 Subject: [PATCH] fix: only close the options window if it's a chrome extension --- src/components/Options.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Options.tsx b/src/components/Options.tsx index 67c751a..156f264 100644 --- a/src/components/Options.tsx +++ b/src/components/Options.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import config, { SuccessOrFailType } from '../config/config'; +import { IS_CHROME } from '../utils'; import apiKeyInvalid from '../utils/apiKey'; import { logUserIn } from '../utils/user'; import SitesList from './SitesList'; @@ -128,7 +129,9 @@ export default function Options(): JSX.Element { whitelist, }); await logUserIn(state.apiKey); - window.close(); + if (IS_CHROME) { + window.close(); + } }; const updateBlacklistState = (sites: string) => {