Commit 9ebf4654 authored by Varun Patil's avatar Varun Patil

Prevent making notification call for guest users

parent 6fdd22fb
...@@ -140,8 +140,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -140,8 +140,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
fetchNotifications();
checkLatestVersion(); checkLatestVersion();
NotificationEventReceiver.setupAlarm(getApplicationContext()); NotificationEventReceiver.setupAlarm(getApplicationContext());
...@@ -394,8 +392,15 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -394,8 +392,15 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
this.menu = menu; this.menu = menu;
fetchNotifications();
getMenuInflater().inflate(R.menu.main, this.menu); getMenuInflater().inflate(R.menu.main, this.menu);
// Fetch notifictions if logged in or hide icon
if (session.isLoggedIn()) {
fetchNotifications();
} else {
this.menu.findItem(R.id.action_notifications).setVisible(false);
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment