Skip to content

Commit

Permalink
fixes for undefined filter in filter on initial startup.
Browse files Browse the repository at this point in the history
did an additional check for undefined for local storage values. been a
while since this was released, and chrome is a rapidly evolving beast,
but this should take care of things for now.
  • Loading branch information
drewcovi committed Jan 28, 2012
1 parent bba1ec6 commit 204d6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/js/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Torrent() {

// test the torrent name against the current filter and set whether it's visible or not
this.filter = function(order) {
var filter = (localStorage.torrentFilter === '') ? '' : new RegExp(localStorage.torrentFilter.replace(/ /g, '[^A-z0-9]*'), 'i'),
var filter = (localStorage.torrentFilter === '' || typeof localStorage.torrentFilter === 'undefined') ? '' : new RegExp(localStorage.torrentFilter.replace(/ /g, '[^A-z0-9]*'), 'i'),
type = localStorage.torrentType,
listElem = document.getElementById('list'), hiddenListElem = document.getElementById('list_hidden');

Expand Down
2 changes: 1 addition & 1 deletion source/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function refreshPopup() {
(function() {
// persistent torrent type dropdown and filter textbox
document.getElementById('filter_type').value = localStorage.torrentType;
if (localStorage.torrentFilter !== '') {
if (localStorage.torrentFilter !== '' && typeof localStorage.torrentFilter !== 'undefined') {
document.getElementById('filter_input').value = localStorage.torrentFilter;
document.getElementById('filter_clear').style.display = 'block';
}
Expand Down

0 comments on commit 204d6ac

Please sign in to comment.