From e45c9c0ed2af3ab308ed1e057ce443660d2092d3 Mon Sep 17 00:00:00 2001 From: Cade Scroggins Date: Sun, 20 Feb 2022 14:43:25 -0800 Subject: [PATCH] prevent path queries from being added to history --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6244e98..3b26128 100644 --- a/index.html +++ b/index.html @@ -876,8 +876,8 @@ localStorage.clear(); } - addItem({ query }) { - if (query.length < this._minChars) return; + addItem({ isPath, query }) { + if (isPath || query.length < this._minChars) return; let exists; const history = this._getHistory().map(([item, count]) => { @@ -1171,6 +1171,7 @@ if (splitPath[0] === key) { res.key = key; + res.isPath = true; res.split = this._pathDelimiter; res.path = QueryParser._shiftAndTrim(splitPath, res.split); @@ -1203,6 +1204,7 @@ if (splitPath[0] === key) { res.key = key; + res.isPath = true; res.split = this._pathDelimiter; res.path = QueryParser._shiftAndTrim(splitPath, res.split); res.redirect = QueryParser._prepPath(url, res.path);