mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Allow custom release URL.
This commit is contained in:
parent
64f1841ae4
commit
e4c4019e25
7 changed files with 27 additions and 21 deletions
|
|
@ -3,12 +3,12 @@ import { FormattedMessage } from 'react-intl';
|
|||
import ButtonLayout from 'components/layout/ButtonLayout';
|
||||
import useStore, { checkVersion } from 'store/version';
|
||||
import { setItem } from 'lib/web';
|
||||
import { VERSION_CHECK, VERSION_URL } from 'lib/constants';
|
||||
import { REPO_URL, VERSION_CHECK } from 'lib/constants';
|
||||
import Button from './Button';
|
||||
import styles from './UpdateNotice.module.css';
|
||||
|
||||
export default function UpdateNotice() {
|
||||
const { latest, checked, hasUpdate } = useStore();
|
||||
const { latest, checked, hasUpdate, releaseUrl } = useStore();
|
||||
const [dismissed, setDismissed] = useState(false);
|
||||
|
||||
const updateCheck = useCallback(() => {
|
||||
|
|
@ -18,7 +18,7 @@ export default function UpdateNotice() {
|
|||
function handleViewClick() {
|
||||
updateCheck();
|
||||
setDismissed(true);
|
||||
location.href = VERSION_URL;
|
||||
location.href = releaseUrl || REPO_URL;
|
||||
}
|
||||
|
||||
function handleDismissClick() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl';
|
|||
import Link from 'components/common/Link';
|
||||
import styles from './Footer.module.css';
|
||||
import useStore from 'store/version';
|
||||
import { HOMEPAGE_URL, VERSION_URL } from 'lib/constants';
|
||||
import { HOMEPAGE_URL, REPO_URL } from 'lib/constants';
|
||||
|
||||
export default function Footer() {
|
||||
const { current } = useStore();
|
||||
|
|
@ -26,8 +26,11 @@ export default function Footer() {
|
|||
/>
|
||||
</div>
|
||||
<div className={classNames(styles.version, 'col-12 col-md-4')}>
|
||||
<Link href={VERSION_URL}>{`v${current}`}</Link>
|
||||
<Link href={REPO_URL}>{`v${current}`}</Link>
|
||||
</div>
|
||||
{!process.env.telemetryDisabled && (
|
||||
<img src={`https://i.umami.is/a.png?v=${current}`} alt="" />
|
||||
)}
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue