Don't show tooltip / hover when no update.

This commit is contained in:
Paul 2021-08-01 17:56:38 +01:00
parent 33baf90d34
commit 591d21c28b
2 changed files with 10 additions and 9 deletions

View file

@ -10,6 +10,7 @@ import { ThemeContext } from "../../context/Theme";
import IconButton from "../ui/IconButton"; import IconButton from "../ui/IconButton";
import { updateSW } from "../../main"; import { updateSW } from "../../main";
import Tooltip from "./Tooltip";
let pendingUpdate = false; let pendingUpdate = false;
internalSubscribe("PWA", "update", () => (pendingUpdate = true)); internalSubscribe("PWA", "update", () => (pendingUpdate = true));
@ -30,9 +31,15 @@ export default function UpdateIndicator({ style }: Props) {
if (style === "titlebar") { if (style === "titlebar") {
return ( return (
<div class="actions">
<Tooltip
content="A new update is available!"
placement="bottom">
<div onClick={() => updateSW(true)}> <div onClick={() => updateSW(true)}>
<CloudDownload size={22} color={theme.success} /> <CloudDownload size={22} color={theme.success} />
</div> </div>
</Tooltip>
</div>
); );
} }

View file

@ -75,13 +75,7 @@ export function Titlebar() {
</svg> </svg>
{window.native.getConfig().build === "dev" && <Wrench />} {window.native.getConfig().build === "dev" && <Wrench />}
</div> </div>
<div class="actions">
<Tooltip
content="A new update is available!"
placement="bottom">
<UpdateIndicator style="titlebar" /> <UpdateIndicator style="titlebar" />
</Tooltip>
</div>
<div class="actions"> <div class="actions">
<div onClick={window.native.min}> <div onClick={window.native.min}>
<Minus size={20} /> <Minus size={20} />