fix: deleted team and it is the current one
This commit is contained in:
parent
3b3c0b94e5
commit
1067f37e4d
1 changed files with 3 additions and 0 deletions
|
|
@ -118,6 +118,9 @@ public function isInstanceAdmin()
|
|||
public function currentTeam()
|
||||
{
|
||||
return Cache::remember('team:' . auth()->user()->id, 3600, function () {
|
||||
if (is_null(data_get(session('currentTeam'), 'id'))) {
|
||||
return auth()->user()->teams[0];
|
||||
}
|
||||
return Team::find(session('currentTeam')->id);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue