Skip to content

Commit

Permalink
Remove needless listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Nov 1, 2023
1 parent d3b0898 commit 1baf60e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
6 changes: 0 additions & 6 deletions webextensions/sidebar/collapse-expand.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ function log(...args) {

export const onUpdating = new EventListenerManager();
export const onUpdated = new EventListenerManager();
export const onRefreshStarted = new EventListenerManager();
export const onRefreshFinished = new EventListenerManager();

export function setCollapsed(tab, info = {}) {
log('setCollapsed ', tab.id, info);
Expand Down Expand Up @@ -78,8 +76,6 @@ export function setCollapsed(tab, info = {}) {
if (tab.status == 'loading')
tab.$TST.addState(Constants.kTAB_STATE_THROBBER_UNSYNCHRONIZED);

onRefreshStarted.dispatch(tab, { collapsed: info.cpllapsed });

const manager = tab.$TST.collapsedStateChangedManager || new EventListenerManager();

if (tab.$TST.updatingCollapsedStateCanceller) {
Expand Down Expand Up @@ -119,7 +115,6 @@ export function setCollapsed(tab, info = {}) {
anchor: info.anchor,
last: info.last
});
onRefreshFinished.dispatch(tab, { collapsed: info.cpllapsed });
};
manager.addListener(onCompleted);

Expand Down Expand Up @@ -147,7 +142,6 @@ export function setCollapsed(tab, info = {}) {

const onCanceled = () => {
manager.removeListener(onCompleted);
onRefreshFinished.dispatch(tab, { collapsed: info.cpllapsed });
};

nextFrame().then(() => {
Expand Down
14 changes: 0 additions & 14 deletions webextensions/sidebar/indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,6 @@ CollapseExpand.onUpdated.addListener((_tab, _options) => {
reserveToUpdateVisualMaxTreeLevel();
});

CollapseExpand.onRefreshStarted.addListener((_tab, _options) => {
if (configs.indentAutoShrink &&
configs.indentAutoShrinkOnlyForVisible)
startBatchToUpdateMaxTreeLevel();
});

CollapseExpand.onRefreshFinished.addListener((_tab, _options) => {
if (configs.indentAutoShrink &&
configs.indentAutoShrinkOnlyForVisible) {
reserveToUpdateVisualMaxTreeLevel();
finishBatchToUpdateMaxTreeLevel();
}
});

const BUFFER_KEY_PREFIX = 'indent-';

BackgroundConnection.onMessage.addListener(async message => {
Expand Down

0 comments on commit 1baf60e

Please sign in to comment.