Simplify logic of hiding bufferline times

codeql
Lorenz Hübschle-Schneider 5 years ago
parent 27134a7f3d
commit effbaff804
  1. 2
      index.html
  2. 10
      js/models.js

@ -395,7 +395,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</li> </li>
</ul> </ul>
</div> </div>
<div id="bufferlines" class="favorite-font" ng-swipe-right="swipeRight()" ng-swipe-left="swipeLeft()" ng-swipe-disable-mouse ng-class="{'withnicklist': showNicklist, 'hideTime': !activeBuffer().showBufferLineTimes}" when-scrolled="infiniteScroll()" imgur-drop> <div id="bufferlines" class="favorite-font" ng-swipe-right="swipeRight()" ng-swipe-left="swipeLeft()" ng-swipe-disable-mouse ng-class="{'withnicklist': showNicklist, 'hideTime': activeBuffer().hideBufferLineTimes}" when-scrolled="infiniteScroll()" imgur-drop>
<table> <table>
<tbody> <tbody>
<tr class="bufferline"> <tr class="bufferline">

@ -92,11 +92,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
var bufferType = message.type; var bufferType = message.type;
// If type is undefined set it as other to avoid later errors // If type is undefined set it as other to avoid later errors
var type = message.local_variables.type; var type = message.local_variables.type || 'other';
if (!type) {
type = 'other';
}
var indent = (['channel', 'private'].indexOf(type) >= 0); var indent = (['channel', 'private'].indexOf(type) >= 0);
var plugin = message.local_variables.plugin; var plugin = message.local_variables.plugin;
@ -105,7 +101,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
var pinned = message.local_variables.pinned === "true"; var pinned = message.local_variables.pinned === "true";
// hide timestamps for certain buffer types // hide timestamps for certain buffer types
var showBufferLineTimes = type && type !== 'relay'; var hideBufferLineTimes = type && type === 'relay';
// Server buffers have this "irc.server.freenode" naming schema, which // Server buffers have this "irc.server.freenode" naming schema, which
// messes the sorting up. We need it to be "irc.freenode" instead. // messes the sorting up. We need it to be "irc.freenode" instead.
@ -374,7 +370,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
getHistoryDown: getHistoryDown, getHistoryDown: getHistoryDown,
isNicklistEmpty: isNicklistEmpty, isNicklistEmpty: isNicklistEmpty,
nicklistRequested: nicklistRequested, nicklistRequested: nicklistRequested,
showBufferLineTimes: showBufferLineTimes, hideBufferLineTimes: hideBufferLineTimes,
pinned: pinned, pinned: pinned,
queryNicklist: queryNicklist, queryNicklist: queryNicklist,
}; };

Loading…
Cancel
Save