Fix incorrect Update button in web version (#3885)
This commit is contained in:
parent
db873a9efa
commit
0515eee3b1
@ -10,7 +10,7 @@ import { LeftColumnContent } from '../../../types';
|
|||||||
|
|
||||||
import { PRODUCTION_URL } from '../../../config';
|
import { PRODUCTION_URL } from '../../../config';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { IS_TOUCH_ENV } from '../../../util/windowEnvironment';
|
import { IS_ELECTRON, IS_TOUCH_ENV } from '../../../util/windowEnvironment';
|
||||||
|
|
||||||
import useForumPanelRender from '../../../hooks/useForumPanelRender';
|
import useForumPanelRender from '../../../hooks/useForumPanelRender';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
@ -127,7 +127,7 @@ const LeftMain: FC<OwnProps> = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleUpdateClick = useLastCallback(() => {
|
const handleUpdateClick = useLastCallback(() => {
|
||||||
if (!isElectronAutoUpdateEnabled) {
|
if (IS_ELECTRON && !isElectronAutoUpdateEnabled) {
|
||||||
window.open(`${PRODUCTION_URL}/get`, '_blank', 'noopener');
|
window.open(`${PRODUCTION_URL}/get`, '_blank', 'noopener');
|
||||||
} else if (isElectronUpdateAvailable) {
|
} else if (isElectronUpdateAvailable) {
|
||||||
window.electron?.installUpdate();
|
window.electron?.installUpdate();
|
||||||
@ -223,7 +223,6 @@ const LeftMain: FC<OwnProps> = ({
|
|||||||
<Button
|
<Button
|
||||||
fluid
|
fluid
|
||||||
pill
|
pill
|
||||||
color={isElectronAutoUpdateEnabled ? 'primary' : 'green'}
|
|
||||||
className={buildClassName('btn-update', updateButtonClassNames)}
|
className={buildClassName('btn-update', updateButtonClassNames)}
|
||||||
onClick={handleUpdateClick}
|
onClick={handleUpdateClick}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user