Thread viewer for Bluesky

simplified url query parsing

Changed files
+3 -8
+3 -8
skythread.js
··· 103 104 function parseQueryParams() { 105 let params = new URLSearchParams(location.search); 106 - let query = params.get('q'); 107 - let author = params.get('author'); 108 - let post = params.get('post'); 109 - let quotes = params.get('quotes'); 110 - let hash = params.get('hash'); 111 - let page = params.get('page'); 112 113 if (quotes) { 114 showLoader(); ··· 116 } else if (hash) { 117 showLoader(); 118 loadHashtagPage(decodeURIComponent(hash)); 119 - } else if (query) { 120 showLoader(); 121 - threadPage.loadThreadByURL(decodeURIComponent(query)); 122 } else if (author && post) { 123 showLoader(); 124 threadPage.loadThreadById(decodeURIComponent(author), decodeURIComponent(post));
··· 103 104 function parseQueryParams() { 105 let params = new URLSearchParams(location.search); 106 + let { q, author, post, quotes, hash, page } = Object.fromEntries(params); 107 108 if (quotes) { 109 showLoader(); ··· 111 } else if (hash) { 112 showLoader(); 113 loadHashtagPage(decodeURIComponent(hash)); 114 + } else if (q) { 115 showLoader(); 116 + threadPage.loadThreadByURL(decodeURIComponent(q)); 117 } else if (author && post) { 118 showLoader(); 119 threadPage.loadThreadById(decodeURIComponent(author), decodeURIComponent(post));