Add tray notification toggle and fix a bug