mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-01-01 10:32:09 +01:00
Fixed: Show an error message after a failed Trakt search
This commit is contained in:
@@ -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}));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user