From 60d09ce7476a6f8dfb0c62ad755123ea278f3bd5 Mon Sep 17 00:00:00 2001
From: Paul <paulmakles@gmail.com>
Date: Sun, 1 Aug 2021 17:56:38 +0100
Subject: [PATCH] Don't show tooltip / hover when no update.

---
 src/components/common/UpdateIndicator.tsx | 11 +++++++++--
 src/components/native/Titlebar.tsx        |  8 +-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/components/common/UpdateIndicator.tsx b/src/components/common/UpdateIndicator.tsx
index 7cc752f..9e015ce 100644
--- a/src/components/common/UpdateIndicator.tsx
+++ b/src/components/common/UpdateIndicator.tsx
@@ -10,6 +10,7 @@ import { ThemeContext } from "../../context/Theme";
 import IconButton from "../ui/IconButton";
 
 import { updateSW } from "../../main";
+import Tooltip from "./Tooltip";
 
 let pendingUpdate = false;
 internalSubscribe("PWA", "update", () => (pendingUpdate = true));
@@ -30,8 +31,14 @@ export default function UpdateIndicator({ style }: Props) {
 
     if (style === "titlebar") {
         return (
-            <div onClick={() => updateSW(true)}>
-                <CloudDownload size={22} color={theme.success} />
+            <div class="actions">
+                <Tooltip
+                    content="A new update is available!"
+                    placement="bottom">
+                    <div onClick={() => updateSW(true)}>
+                        <CloudDownload size={22} color={theme.success} />
+                    </div>
+                </Tooltip>
             </div>
         );
     }
diff --git a/src/components/native/Titlebar.tsx b/src/components/native/Titlebar.tsx
index 6e17ee4..3a8b680 100644
--- a/src/components/native/Titlebar.tsx
+++ b/src/components/native/Titlebar.tsx
@@ -75,13 +75,7 @@ export function Titlebar() {
                 </svg>
                 {window.native.getConfig().build === "dev" && <Wrench />}
             </div>
-            <div class="actions">
-                <Tooltip
-                    content="A new update is available!"
-                    placement="bottom">
-                    <UpdateIndicator style="titlebar" />
-                </Tooltip>
-            </div>
+            <UpdateIndicator style="titlebar" />
             <div class="actions">
                 <div onClick={window.native.min}>
                     <Minus size={20} />
-- 
GitLab