diff --git a/main.go b/main.go index c54deee..925fe92 100644 --- a/main.go +++ b/main.go @@ -50,9 +50,6 @@ func main() { ui.Ui = ui.NewApplication() - // Connecting the Notification Server to the Main UI - notify.ConnectUI(ui.Ui) - fileMap, err := CONN.ListAllInfo("/") if err != nil { utils.Print("RED", "Could Not Generate the File Map\n") diff --git a/notify/notification.go b/notify/notification.go index b333cb1..1c89258 100644 --- a/notify/notification.go +++ b/notify/notification.go @@ -4,7 +4,6 @@ import ( "time" "github.com/aditya-K2/gomp/ui" - "github.com/aditya-K2/gomp/utils" "github.com/aditya-K2/tview" @@ -12,7 +11,6 @@ import ( ) var ( - UI *ui.Application Notify *NotificationServer ) @@ -22,10 +20,6 @@ type Notification struct { Text string } -func ConnectUI(a *ui.Application) { - UI = a -} - /* Get A Pointer to A Notification Struct */ func NewNotification(s string) *Notification { return &Notification{ @@ -80,11 +74,11 @@ func NotificationRoutine(c chan string, s string) { if s != "EMPTY NOTIFICATION" { go func() { currentTime := time.Now().String() - UI.Pages.AddPage(currentTime, NewNotification(s), false, true) - UI.App.SetFocus(UI.ExpandedView) + ui.Ui.Pages.AddPage(currentTime, NewNotification(s), false, true) + ui.Ui.App.SetFocus(ui.Ui.ExpandedView) time.Sleep(time.Second * 1) - UI.Pages.RemovePage(currentTime) - UI.App.SetFocus(UI.ExpandedView) + ui.Ui.Pages.RemovePage(currentTime) + ui.Ui.App.SetFocus(ui.Ui.ExpandedView) }() } NewNotification := <-c