ui: remove "service worker updated" popup
It's distracting, typically unactionable, and covers up the omnibar.
I would like to see it gone, especially on autopush.
Change-Id: I0f4af36f4084f8fd3a983bb5e35acd6b92678551
diff --git a/ui/src/frontend/globals.ts b/ui/src/frontend/globals.ts
index 2619d55..2b31fb9 100644
--- a/ui/src/frontend/globals.ts
+++ b/ui/src/frontend/globals.ts
@@ -283,7 +283,6 @@
scrollToTrackKey?: string | number;
httpRpcState: HttpRpcState = {connected: false};
- newVersionAvailable = false;
showPanningHint = false;
permalinkHash?: string;
diff --git a/ui/src/frontend/service_worker_controller.ts b/ui/src/frontend/service_worker_controller.ts
index f33ffaf..980100d 100644
--- a/ui/src/frontend/service_worker_controller.ts
+++ b/ui/src/frontend/service_worker_controller.ts
@@ -54,7 +54,6 @@
}
export class ServiceWorkerController {
- private _initialWorker: ServiceWorker | null = null;
private _bypassed = false;
private _installing = false;
@@ -84,13 +83,6 @@
this._installing = true;
} else if (sw.state === 'activated') {
this._installing = false;
- // Don't show the notification if the site was served straight
- // from the network (e.g., on the very first visit or after
- // Ctrl+Shift+R). In these cases, we are already at the last
- // version.
- if (sw !== this._initialWorker && this._initialWorker) {
- globals.newVersionAvailable = true;
- }
}
}
@@ -134,8 +126,6 @@
const versionDir = globals.root.split('/').slice(-2)[0];
const swUri = `/service_worker.js?v=${versionDir}`;
navigator.serviceWorker.register(swUri).then((registration) => {
- this._initialWorker = registration.active;
-
// At this point there are two options:
// 1. This is the first time we visit the site (or cache was cleared) and
// no SW is installed yet. In this case |installing| will be set.
diff --git a/ui/src/frontend/topbar.ts b/ui/src/frontend/topbar.ts
index 6546c64..331ad24 100644
--- a/ui/src/frontend/topbar.ts
+++ b/ui/src/frontend/topbar.ts
@@ -16,7 +16,6 @@
import {classNames} from '../base/classnames';
import {raf} from '../core/raf_scheduler';
-import {VERSION} from '../gen/perfetto_version';
import {globals} from './globals';
import {taskTracker} from './task_tracker';
@@ -39,25 +38,6 @@
}
}
-class NewVersionNotification implements m.ClassComponent {
- view() {
- return m(
- '.new-version-toast',
- `Updated to ${VERSION} and ready for offline use!`,
- m(
- 'button.notification-btn.preferred',
- {
- onclick: () => {
- globals.newVersionAvailable = false;
- raf.scheduleFullRedraw();
- },
- },
- 'Dismiss',
- ),
- );
- }
-}
-
class HelpPanningNotification implements m.ClassComponent {
view() {
const dismissed = localStorage.getItem(DISMISSED_PANNING_HINT_KEY);
@@ -130,7 +110,7 @@
return m(
'.topbar',
{class: globals.state.sidebarVisible ? '' : 'hide-sidebar'},
- globals.newVersionAvailable ? m(NewVersionNotification) : omnibox,
+ omnibox,
m(Progress),
m(HelpPanningNotification),
m(TraceErrorIcon),