mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix search when session has expired
This commit is contained in:
parent
65d0e350d0
commit
a56134050d
@ -265,7 +265,7 @@
|
|||||||
|
|
||||||
if (!window.loadedSearchData) {
|
if (!window.loadedSearchData) {
|
||||||
trackEvent('/activity', '/search');
|
trackEvent('/activity', '/search');
|
||||||
$.get('{{ URL::route('getSearchData') }}', function(data) {
|
var request = $.get('{{ URL::route('getSearchData') }}', function(data) {
|
||||||
$('#search').typeahead({
|
$('#search').typeahead({
|
||||||
hint: true,
|
hint: true,
|
||||||
highlight: true,
|
highlight: true,
|
||||||
@ -308,6 +308,13 @@
|
|||||||
}).focus();
|
}).focus();
|
||||||
window.loadedSearchData = true;
|
window.loadedSearchData = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
request.error(function(httpObj, textStatus) {
|
||||||
|
// if the session has expried show login page
|
||||||
|
if (httpObj.status == 401) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user