Skip to content

Commit bf46f38

Browse files
committed
Merge branch 'develop'
2 parents d279e21 + e5d8548 commit bf46f38

3 files changed

Lines changed: 12 additions & 31 deletions

File tree

src/app/search/controller.js

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ angular.module('spotmop.search', [])
2828
$scope.artists = [];
2929
$scope.playlists = [];
3030
$scope.type = $stateParams.type;
31-
$scope.query = $filter('stripAccents')( $stateParams.query );
31+
$scope.query = '';
32+
if( $stateParams.query )
33+
$scope.query = $filter('stripAccents')( $stateParams.query );
34+
3235
$scope.loading = false;
3336
var searchDelayer;
34-
37+
3538
// focus on our search field on load (if not touch device, otherwise we get annoying on-screen keyboard)
3639
if( !$scope.isTouchDevice() )
3740
$(document).find('.search-form input.query').focus();
@@ -40,31 +43,6 @@ angular.module('spotmop.search', [])
4043
if( $scope.query )
4144
performSearch( $scope.type, $scope.query );
4245

43-
/**
44-
* Watch our query string for changes
45-
* When changed, clear all results, wait for 0.5 seconds for next key, then fire off the search
46-
var tempQuery = '', queryTimeout;
47-
$scope.$watch('query', function(newValue, oldValue){
48-
49-
if( newValue != oldValue && newValue && newValue != '' ){
50-
$scope.loading = true;
51-
$scope.tracklist = {tracks: [], type: 'track'};
52-
$scope.albums = [];
53-
$scope.artists = [];
54-
$scope.playlists = [];
55-
56-
if (queryTimeout)
57-
$timeout.cancel(queryTimeout);
58-
59-
tempQuery = newValue;
60-
queryTimeout = $timeout(function() {
61-
$scope.query = tempQuery;
62-
performSearch( $scope.type, $scope.query );
63-
}, 1000);
64-
}
65-
})
66-
**/
67-
6846

6947
/**
7048
* Fetch the search results

src/app/services/pusher/service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ angular.module('spotmop.services.pusher', [
5757
}
5858

5959
// notify server of our actual username
60-
var name = SettingsService.getSetting('pushername', null)
60+
var name = SettingsService.getSetting('pushername', '')
6161
if( name )
6262
service.setMe( name );
6363

6464
// standard notification, fire it out!
6565
}else{
6666
// make sure we're not notifying ourselves
67-
if( data.id != SettingsService.getSetting('pusherid', null) && !SettingsService.getSetting('pusherdisabled', false) )
67+
if( data.id != SettingsService.getSetting('pusherid', '') && !SettingsService.getSetting('pusherdisabled', false) )
6868
$rootScope.$broadcast('spotmop:pusher:received', data);
6969
}
7070
}

src/app/settings/service.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ angular.module('spotmop.services.settings', [])
5353
* @param property = string (optional sub-property)
5454
**/
5555
getSetting: function( setting, defaultValue, property ){
56-
56+
5757
if( typeof(property) === 'undefined')
5858
property = false;
5959

60+
// if we're getting a sub-property
6061
if( property ){
61-
if( typeof($localStorage.settings[setting][property]) !== 'undefined' ){
62+
63+
// make sure our parent property, and sub-property exist
64+
if( typeof($localStorage.settings[setting]) !== 'undefined' && typeof($localStorage.settings[setting][property]) !== 'undefined' ){
6265
return $localStorage.settings[setting][property];
6366
}
6467
}else{

0 commit comments

Comments
 (0)