From dec94a1160cb2e3b88b802cb6e43ed51253e64f3 Mon Sep 17 00:00:00 2001 From: 101arrowz Date: Wed, 23 Oct 2019 21:51:20 -0700 Subject: [PATCH] Changed cookies to localStorage --- api/analyze.js | 2 +- api/search.js | 6 ------ html/comments.html | 12 +++++------- html/level.html | 17 ++++++++--------- html/search.html | 6 +++--- index.js | 1 - package.json | 1 - 7 files changed, 17 insertions(+), 28 deletions(-) diff --git a/api/analyze.js b/api/analyze.js index 726aec3..0a9389c 100644 --- a/api/analyze.js +++ b/api/analyze.js @@ -7,7 +7,7 @@ const blocks = require('../misc/blocks.json') module.exports = async (app, req, res, level) => { -let levelString = new Buffer(level.data, 'base64') +let levelString = Buffer.from(level.data, 'base64') let buffer; let response = {}; diff --git a/api/search.js b/api/search.js index ed9c1e8..0d5245e 100644 --- a/api/search.js +++ b/api/search.js @@ -56,12 +56,6 @@ module.exports = async (app, req, res) => { if (filterCheck == 'magic') filters.type = 7 if (filterCheck == 'awarded' || filterCheck == 'starred') filters.type = 11 if (filterCheck == 'halloffame' || filterCheck == 'hof') filters.type = 16 - - if (filterCheck == 'saved') { - if (!req.cookies.saved) return res.send("-1") - filters.str = req.cookies.saved.split(',').slice(10 * filters.page).slice(0, 10).join(",") - if (!filters.str.length) return res.send("-1") - } } if (req.query.hasOwnProperty("user")) { diff --git a/html/comments.html b/html/comments.html index bf93cef..ca58e3f 100644 --- a/html/comments.html +++ b/html/comments.html @@ -73,16 +73,12 @@