@@ -19,7 +19,7 @@ import {
1919} from '../actions/actions' ;
2020import { useStoreContext } from '../store' ;
2121
22- function MainContainer ( ) : any {
22+ function MainContainer ( ) : JSX . Element {
2323 const [ store , dispatch ] = useStoreContext ( ) ;
2424 const {
2525 tabs, currentTab, port, split,
@@ -28,6 +28,7 @@ function MainContainer(): any {
2828 // this function handles Time Jump sidebar view
2929 const toggleActionContainer = ( ) => {
3030 setActionView ( ! actionView ) ;
31+ // aside is like an added text that appears "on the side" aside some text.
3132 const toggleElem = document . querySelector ( 'aside' ) ;
3233 toggleElem . classList . toggle ( 'no-aside' ) ;
3334 // hides the record toggle button from Actions Container in Time Jump sidebar view
@@ -47,15 +48,16 @@ function MainContainer(): any {
4748 const currentPort = chrome . runtime . connect ( ) ;
4849 // listen for a message containing snapshots from the background script
4950 currentPort . onMessage . addListener (
51+ // parameter message is an object with following type script properties
5052 ( message : {
5153 action : string ;
5254 payload : Record < string , unknown > ;
5355 sourceTab : number ;
5456 } ) => {
5557 const { action, payload, sourceTab } = message ;
56- let maxTab ;
58+ let maxTab : number ;
5759 if ( ! sourceTab ) {
58- const tabsArray : any = Object . keys ( payload ) ;
60+ const tabsArray : Array < string > = Object . keys ( payload ) ;
5961 maxTab = Math . max ( ...tabsArray ) ;
6062 }
6163 switch ( action ) {
@@ -92,7 +94,7 @@ function MainContainer(): any {
9294 ) ;
9395
9496 currentPort . onDisconnect . addListener ( ( ) => {
95- console . log ( 'this port is disconeccting line 79' ) ;
97+ console . log ( 'this port is disconnecting line 79' ) ;
9698 // disconnecting
9799 } ) ;
98100
0 commit comments