Add go home links in popup menu
This commit is contained in:
+9
-2
@@ -8,8 +8,6 @@ import "assets/global.less";
|
||||
import styles from "./popup.module.less";
|
||||
|
||||
function IndexPopup() {
|
||||
const [data, setData] = useState("")
|
||||
|
||||
const [tab, setTab] = useState<string>();
|
||||
|
||||
const onBack = () => {
|
||||
@@ -21,6 +19,15 @@ function IndexPopup() {
|
||||
chrome.runtime.openOptionsPage();
|
||||
return;
|
||||
}
|
||||
else if (value === "home") {
|
||||
chrome.storage.local.get(["siteUrl"]).then((res) => {
|
||||
if (res.siteUrl) {
|
||||
chrome.tabs.create({ url: res.siteUrl });
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setTab(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user