* applied eslint * add locales and lint the project * removed error boundary * updated locales * fix min files * fix locales
23 lines
594 B
TypeScript
23 lines
594 B
TypeScript
import ListWalker from '../../common/ListWalker';
|
|
import type { TabChange } from '../messages';
|
|
|
|
export default class ActiveTabManager extends ListWalker<TabChange> {
|
|
currentTime = 0;
|
|
|
|
tabInstances: Set<string> = new Set();
|
|
|
|
moveReady(t: number): Promise<string | null> {
|
|
if (t < this.currentTime) {
|
|
this.reset();
|
|
}
|
|
this.currentTime = t;
|
|
const msg = this.moveGetLast(t);
|
|
|
|
if (msg) {
|
|
const ids = this.listNow.map((m) => m.tabId);
|
|
this.tabInstances = new Set(ids);
|
|
return Promise.resolve(msg.tabId);
|
|
}
|
|
return Promise.resolve(null);
|
|
}
|
|
}
|