This commit is contained in:
IndieKKY
2024-09-19 16:23:13 +08:00
parent ff6dae7a21
commit 78b5d7a18b
3 changed files with 69 additions and 48 deletions

View File

@@ -4,6 +4,7 @@ import { IoMdClose } from 'react-icons/io';
import { setTempData } from '../redux/envReducer';
import { useAppDispatch, useAppSelector } from '../hooks/redux';
import { openUrl } from '@kky002/kky-util';
import { isEdgeBrowser } from '../util/util';
const RateExtension: React.FC = () => {
const dispatch = useAppDispatch()
@@ -15,7 +16,11 @@ const RateExtension: React.FC = () => {
reviewed: true
}))
// Chrome Web Store URL for your extension
openUrl(import.meta.env.VITE_REVIEW_URL)
if (isEdgeBrowser()) {
openUrl('https://microsoftedge.microsoft.com/addons/detail/lignnlhlpiefmcjkdkmfjdckhlaiajan')
} else {
openUrl('https://chrome.google.com/webstore/detail/bciglihaegkdhoogebcdblfhppoilclp/reviews')
}
};
if (reviewed === true || reviewed === undefined) return null;

View File

@@ -1,5 +1,10 @@
import {SyntheticEvent} from 'react'
export const isEdgeBrowser = () => {
const userAgent = navigator.userAgent.toLowerCase();
return userAgent.includes('edg/') && !userAgent.includes('edge/');
}
export const formatTime = (time: number) => {
if (!time) return '00:00'