mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
Fixed: Show an error message after a failed Trakt search
This commit is contained in:
parent
e6494ba229
commit
c159a378a0
3 changed files with 43 additions and 3 deletions
|
@ -1,15 +1,16 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'underscore',
|
||||
'vent',
|
||||
'marionette',
|
||||
'AddSeries/AddSeriesCollection',
|
||||
'AddSeries/SearchResultCollectionView',
|
||||
'AddSeries/EmptyView',
|
||||
'AddSeries/NotFoundView',
|
||||
'Shared/LoadingView',
|
||||
'underscore'
|
||||
], function (vent, Marionette, AddSeriesCollection, SearchResultCollectionView, EmptyView, NotFoundView, LoadingView, _) {
|
||||
'AddSeries/ErrorView',
|
||||
'Shared/LoadingView'
|
||||
], function (_, vent, Marionette, AddSeriesCollection, SearchResultCollectionView, EmptyView, NotFoundView, ErrorView, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'AddSeries/AddSeriesViewTemplate',
|
||||
|
||||
|
@ -83,6 +84,7 @@ define(
|
|||
},
|
||||
|
||||
search: function (options) {
|
||||
var self = this;
|
||||
|
||||
this.collection.reset();
|
||||
|
||||
|
@ -96,6 +98,10 @@ define(
|
|||
data: { term: options.term }
|
||||
});
|
||||
|
||||
this.currentSearchPromise.fail(function () {
|
||||
self._showError();
|
||||
});
|
||||
|
||||
return this.currentSearchPromise;
|
||||
},
|
||||
|
||||
|
@ -155,6 +161,13 @@ define(
|
|||
else {
|
||||
this._clearResults();
|
||||
}
|
||||
},
|
||||
|
||||
_showError: function () {
|
||||
if (!this.isClosed) {
|
||||
this.ui.searchBar.show();
|
||||
this.searchResult.show(new ErrorView({term: this.collection.term}));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue