refactor: remove extra non-essential logging

This commit is contained in:
sethburkart123
2024-06-09 17:30:46 +10:00
parent e0ac71eba4
commit 13e1a832f2
8 changed files with 6 additions and 18 deletions
+1 -4
View File
@@ -98,7 +98,6 @@ export function enableAnimatedBackground() {
async function HideMenuItems(): Promise<void> { async function HideMenuItems(): Promise<void> {
try { try {
let stylesheetInnerText: string = '' let stylesheetInnerText: string = ''
console.log('ASssessments: ', settingsState.menuitems)
for (const [menuItem, { toggle }] of Object.entries(settingsState.menuitems)) { for (const [menuItem, { toggle }] of Object.entries(settingsState.menuitems)) {
if (!toggle) { if (!toggle) {
stylesheetInnerText += SetDisplayNone(menuItem) stylesheetInnerText += SetDisplayNone(menuItem)
@@ -1007,7 +1006,7 @@ export function OpenMenuOptions() {
}, },
}); });
} catch (err) { } catch (err) {
console.log(err) console.error(err)
} }
function changeDisplayProperty(element: any) { function changeDisplayProperty(element: any) {
@@ -1048,7 +1047,6 @@ export function OpenMenuOptions() {
} }
function closeAll() { function closeAll() {
console.log("Closing!")
menusettings?.remove() menusettings?.remove()
cover?.remove() cover?.remove()
MenuOptionsOpen = false MenuOptionsOpen = false
@@ -2357,7 +2355,6 @@ export function SendNewsPage() {
AppendLoadingSymbol('newsloading', '#news-container') AppendLoadingSymbol('newsloading', '#news-container')
browser.runtime.sendMessage({ type: 'sendNews' }).then(function (response) { browser.runtime.sendMessage({ type: 'sendNews' }).then(function (response) {
console.log(response)
let newsarticles = response.news.articles let newsarticles = response.news.articles
var newscontainer = document.querySelector('#news-container') var newscontainer = document.querySelector('#news-container')
document.getElementById('newsloading')!.remove() document.getElementById('newsloading')!.remove()
+3 -5
View File
@@ -1,5 +1,4 @@
import browser from 'webextension-polyfill' import browser from 'webextension-polyfill'
import { onError } from './seqta/utils/onError';
import { SettingsState } from "./types/storage"; import { SettingsState } from "./types/storage";
import { applyYoutubeStyles } from './seqta/ui/VideoLoader'; import { applyYoutubeStyles } from './seqta/ui/VideoLoader';
@@ -68,7 +67,7 @@ function reloadSeqtaPages() {
} }
} }
} }
result.then(open, onError) result.then(open, console.error)
} }
// Main message listener // Main message listener
@@ -105,7 +104,6 @@ browser.runtime.onMessage.addListener((request: any, _sender: any, sendResponse:
break; break;
case 'sendNews': case 'sendNews':
console.log("Sending news")
const date = new Date(); const date = new Date();
const from = const from =
@@ -275,7 +273,7 @@ function UpdateCurrentValues() {
SetStorageValue(NewValue); SetStorageValue(NewValue);
} }
result.then(open, onError) result.then(open, console.error)
} }
function migrateOldStorage() { function migrateOldStorage() {
@@ -310,7 +308,7 @@ function migrateOldStorage() {
setting.then(() => console.log('Migration Completed.')) setting.then(() => console.log('Migration Completed.'))
} }
} }
result.then(open, onError) result.then(open, console.error)
} }
browser.runtime.onInstalled.addListener(function (event) { browser.runtime.onInstalled.addListener(function (event) {
-1
View File
@@ -6,7 +6,6 @@ import { settingsState } from "../utils/listeners/SettingsState";
import { updateAllColors } from "./colors/Manager"; import { updateAllColors } from "./colors/Manager";
export async function AddBetterSEQTAElements() { export async function AddBetterSEQTAElements() {
console.log('AddBetterSEQTAElements');
if (settingsState.onoff) { if (settingsState.onoff) {
initializeSettings(); initializeSettings();
if (settingsState.DarkMode) { if (settingsState.DarkMode) {
-1
View File
@@ -18,7 +18,6 @@ export function updateBgDurations() {
maxBase = 150, maxBase = 150,
) => { ) => {
const scaledValue = 2 + ((maxBase - baseValue) / (maxBase - minBase)) ** 4; const scaledValue = 2 + ((maxBase - baseValue) / (maxBase - minBase)) ** 4;
console.log(scaledValue);
return scaledValue + offset; return scaledValue + offset;
}; };
+1 -3
View File
@@ -108,10 +108,8 @@ const main = async (): Promise<void> => {
} }
}); });
} catch (error) { } catch (error) {
console.log('An error occurred:', error); console.error('An error occurred:', error);
} }
}; };
main() main()
// Run the main function when the document is ready
//document.addEventListener('DOMContentLoaded', main);
@@ -18,7 +18,6 @@ class StorageManager {
if (prop in target) { if (prop in target) {
return (target as any)[prop]; return (target as any)[prop];
} }
//console.log(this.data[prop], prop, this.data)
return Reflect.get(target.data, prop); return Reflect.get(target.data, prop);
}, },
set: (target, prop: keyof SettingsState, value) => { set: (target, prop: keyof SettingsState, value) => {
@@ -67,7 +67,6 @@ export class StorageChangeHandler {
} }
private handleShortcutsChange(newValue: { enabled: boolean, name: string }[], oldValue: { enabled: boolean, name: string }[]) { private handleShortcutsChange(newValue: { enabled: boolean, name: string }[], oldValue: { enabled: boolean, name: string }[]) {
console.log(oldValue, newValue);
const addedShortcuts = newValue.filter((newItem: any) => { const addedShortcuts = newValue.filter((newItem: any) => {
const isAdded = oldValue.some((oldItem: any) => { const isAdded = oldValue.some((oldItem: any) => {
const match = oldItem.name === newItem.name; const match = oldItem.name === newItem.name;
-1
View File
@@ -1 +0,0 @@
export function onError (error: string) { console.log(`Error: ${error}`) }