From 2583d4cd4b8a5f8b3acc3c0e0970adf295d4d8c5 Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Thu, 13 Aug 2020 14:50:06 +0530
Subject: location of mainviewnotifs notification bubble should be fixed +
 Anika's defaultaclprivate fix

---
 src/client/views/MainViewNotifs.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/client/views/MainViewNotifs.tsx')

diff --git a/src/client/views/MainViewNotifs.tsx b/src/client/views/MainViewNotifs.tsx
index 89006ebc8..c0cd7b3a7 100644
--- a/src/client/views/MainViewNotifs.tsx
+++ b/src/client/views/MainViewNotifs.tsx
@@ -8,6 +8,7 @@ import { DragManager } from '../util/DragManager';
 import "./MainViewNotifs.scss";
 import { MainView } from './MainView';
 import { NumCast } from '../../fields/Types';
+import { Id } from '../../fields/FieldSymbols';
 
 
 @observer
@@ -28,7 +29,14 @@ export class MainViewNotifs extends React.Component {
 
     render() {
         const length = MainViewNotifs.NotifsCol ? DocListCast(MainViewNotifs.NotifsCol.data).length : 0;
-        return <div className="mainNotifs-container" style={{ width: 15, height: 15, top: 12 + NumCast(MainViewNotifs.NotifsCol?.position) * 60 }} ref={this._notifsRef}>
+        const menuStack = Doc.UserDoc().menuStack as Doc;
+        const menuButtons = DocListCast(menuStack.data);
+        let top = 12 - NumCast(menuStack._scrollTop);
+        for (const button of menuButtons) {
+            if (button[Id] !== menuStack.sharingButtonId) top += NumCast(button._height);
+            else break;
+        }
+        return <div className="mainNotifs-container" style={{ width: 15, height: 15, top }} ref={this._notifsRef}>
             <button className="mainNotifs-badge" style={length > 0 ? { "display": "initial" } : { "display": "none" }}
                 onPointerDown={this.onPointerDown} >
                 {length}
-- 
cgit v1.2.3-70-g09d2

