Skip to content

Commit 76a7e04

Browse files
committed
chore: remove :ready event
1 parent 8a23045 commit 76a7e04

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/hooks/zz.loaded.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { scriptVersion } from '../utils/1.variables';
33
import { getPageName } from '../utils/onPage';
44

55
function loaded() {
6-
// TODO: needs to do this faster, due to new script builder, impossible to make this go last (without a bunch of work)
7-
eventManager.singleton.emit(':ready');
86
eventManager.singleton.emit(':loaded');
97
eventManager.singleton.emit(`:loaded:${getPageName()}`);
108
}
@@ -13,8 +11,13 @@ function done() {
1311
eventManager.singleton.emit(`:load:${getPageName()}`);
1412
}
1513

16-
if (location.host.includes('undercards.net') && document.title.includes('Undercards')) {
14+
if (location.host.includes('undercards.net')) {
1715
console.log(`UnderScript(v${scriptVersion}): Loaded`); // eslint-disable-line no-console
16+
if (document.title.includes('Undercards')) {
17+
register();
18+
}
19+
}
20+
function register() {
1821
document.addEventListener('DOMContentLoaded', loaded);
1922
window.addEventListener('load', done);
2023
const COMPLETE = document.readyState === 'complete';

src/utils/settings/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export function importSettings(string) {
406406
init('main');
407407

408408
// Add our button last
409-
eventManager.on(':ready', () => {
409+
eventManager.on(':load', () => {
410410
menu.addButton({
411411
text: 'Settings',
412412
action: () => {

0 commit comments

Comments
 (0)