fix save rule

This commit is contained in:
Gabe Yuan
2023-09-12 17:20:56 +08:00
parent 5e8743dbb7
commit 56281f9e82
3 changed files with 55 additions and 55 deletions

View File

@@ -21,7 +21,12 @@ export default function Header({ setShowPopup }) {
<IconButton onClick={handleHomepage}>
<HomeIcon />
</IconButton>
<Box>
<Box
sx={{
userSelect: "none",
WebkitUserSelect: "none",
}}
>
{`${process.env.REACT_APP_NAME} v${process.env.REACT_APP_VERSION}`}
</Box>
</Stack>

View File

@@ -80,13 +80,12 @@ export default function Popup({ setShowPopup, translator: tran }) {
const handleSaveRule = async () => {
try {
let host = window.location.host;
let href = window.location.href;
if (isExt) {
const tab = await getTabInfo();
const url = new URL(tab.url);
host = url.host;
href = tab.url;
}
saveRule({ ...rule, pattern: host });
saveRule({ ...rule, pattern: href });
} catch (err) {
console.log("[save rule]", err);
}