Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 2ee19c2

Browse files
committed
Changed default sort order to be by upload date
1 parent 130b775 commit 2ee19c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/background.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ var NOTIFICATION_ACTIONS = {
214214
)
215215
};
216216

217+
// TODO: FIX "fixXXXXXStructure"
217218
if(localStorage.getItem("channels") == null)
218219
localStorage.setItem("channels", JSON.stringify([]));
219220
if(localStorage.getItem("settings") == null)
@@ -236,7 +237,7 @@ if(localStorage.getItem("settings") == null)
236237
id: ""
237238
},
238239
extendedAuthToken: "",
239-
sortOrder: SORTMODE_USER,
240+
sortOrder: SORTMODE_UPLOAD,
240241
notificationSound: NOTIFICATIONSOUND_DEFAULT,
241242
notificationActions: [NOTIFICATION_ACTION_WATCHVIDEO, NOTIFICATION_ACTION_WATCHLATER]
242243
}));
@@ -245,6 +246,7 @@ fixSettingsStructure();
245246
fixChannelStructure();
246247
function fixSettingsStructure(){
247248
var settings = JSON.parse(localStorage.getItem("settings"));
249+
248250
if(typeof settings.notifications === "undefined" || settings.notifications.enabled === "undefined" || settings.notifications.volume === "undefined"){
249251
settings.notifications = {
250252
enabled: true,
@@ -331,6 +333,7 @@ function fixSettingsStructure(){
331333
*/
332334
function fixChannelStructure() {
333335
var channels = JSON.parse(localStorage.getItem("channels"));
336+
334337
for(var i = 0; i < channels.length; i++) {
335338
if(typeof channels[i].hasNewVideo !== "boolean") {
336339
channels[i].hasNewVideo = false;

0 commit comments

Comments
 (0)