11import  dayjs  from  'dayjs' 
2- import  {  StorageValue ,  Phase ,  DailyPomodoro ,  Message  }  from  '.. /types' 
3- import  {  getStorage ,  runtime ,  setStorage  }  from  '.. /utils/chrome' 
2+ import  {  StorageValue ,  Phase ,  DailyPomodoro ,  Message  }  from  '@ /types' 
3+ import  {  getStorage ,  runtime ,  setStorage  }  from  '@ /utils/chrome' 
44import  {  updateSecondsOfBadge ,  updateColorOfBadge  }  from  './Action' 
55import  {  closeTabs ,  openNewTab  }  from  './Tab' 
66import  {  createNotificationContent ,  sendNotification  }  from  './Notification' 
7- import  keepAlive  from  '.. /utils/keepAliveServiceWorker' 
8- import  {  FromServiceWorkerMessgeType  }  from  '.. /utils/message' 
9- import  {  extractTodayPomodoroCount  }  from  '.. /utils/pomodoroHelper' 
7+ import  keepAlive  from  '@ /utils/keepAliveServiceWorker' 
8+ import  {  FromServiceWorkerMessageType  }  from  '@ /utils/message' 
9+ import  {  extractTodayPomodoroCount  }  from  '@ /utils/pomodoroHelper' 
1010
1111let  intervalId  =  0 
1212
1313const  toggleTimerStatus  =  async  ( needSendMessage  =  false ) : Promise < void >  =>  { 
1414  await  keepAlive ( ) 
1515
1616  getStorage ( [ 
17-     'reminingSeconds ' , 
17+     'remainingSeconds ' , 
1818    'phase' , 
1919    'isRunning' , 
2020    'totalPomodoroCountsInSession' 
@@ -28,7 +28,7 @@ const toggleTimerStatus = async (needSendMessage = false): Promise<void> => {
2828      } 
2929      if  ( needSendMessage )  { 
3030        await  runtime . sendMessage < Message > ( { 
31-           type : FromServiceWorkerMessgeType . TOGGLE_TIMER_STATUS , 
31+           type : FromServiceWorkerMessageType . TOGGLE_TIMER_STATUS , 
3232          data : { 
3333            toggledTimerStatus : ! data . isRunning 
3434          } 
@@ -53,12 +53,12 @@ const setTickInterval = (isRunning: boolean): void => {
5353 * カウントを減らすか終了させるか判定 
5454 */ 
5555const  handleCountDown  =  ( ) : void =>  { 
56-   getStorage ( [ 'reminingSeconds ' ] ) . then ( async  ( data : StorageValue )  =>  { 
57-     if  ( data . reminingSeconds  >  0 )  { 
58-       await  reduceCount ( data . reminingSeconds ) 
56+   getStorage ( [ 'remainingSeconds ' ] ) . then ( async  ( data : StorageValue )  =>  { 
57+     if  ( data . remainingSeconds  >  0 )  { 
58+       await  reduceCount ( data . remainingSeconds ) 
5959    } 
6060
61-     if  ( data . reminingSeconds  ===  1 )  { 
61+     if  ( data . remainingSeconds  ===  1 )  { 
6262      const  { 
6363        phase, 
6464        totalPomodoroCountsInSession, 
@@ -80,14 +80,14 @@ const handleCountDown = (): void => {
8080  } ) 
8181} 
8282
83- const  reduceCount  =  async  ( reminingSeconds : number ) : Promise < void >  =>  { 
83+ const  reduceCount  =  async  ( remainingSeconds : number ) : Promise < void >  =>  { 
8484  try  { 
85-     setStorage ( {  reminingSeconds :  reminingSeconds  -  1  } ) 
86-     await  updateSecondsOfBadge ( reminingSeconds  -  1 ) 
85+     setStorage ( {  remainingSeconds :  remainingSeconds  -  1  } ) 
86+     await  updateSecondsOfBadge ( remainingSeconds  -  1 ) 
8787    await  runtime . sendMessage < Message > ( { 
88-       type : FromServiceWorkerMessgeType . REDUCE_COUNT , 
88+       type : FromServiceWorkerMessageType . REDUCE_COUNT , 
8989      data : { 
90-         secs : reminingSeconds  -  1 
90+         secs : remainingSeconds  -  1 
9191      } 
9292    } ) 
9393  }  catch  ( e )  { 
@@ -105,7 +105,7 @@ const expire = async (
105105  pomodorosUntilLongBreak : number , 
106106  isAutoExpire  =  true 
107107) : Promise < void >  =>  { 
108-   let  reminingSeconds  =  0 
108+   let  remainingSeconds  =  0 
109109  let  nextPhase : Phase  =  'focus' 
110110
111111  try  { 
@@ -114,34 +114,34 @@ const expire = async (
114114    if  ( phase  ===  'focus' )  { 
115115      totalPomodoroCountsInSession ++ 
116116      if  ( totalPomodoroCountsInSession  >=  pomodorosUntilLongBreak )  { 
117-         reminingSeconds  =  await  ( 
117+         remainingSeconds  =  await  ( 
118118          await  getStorage ( [ 'longBreakSeconds' ] ) 
119119        ) . longBreakSeconds 
120120        totalPomodoroCountsInSession  =  0 
121121        nextPhase  =  'longBreak' 
122122      }  else  { 
123-         reminingSeconds  =  await  ( 
123+         remainingSeconds  =  await  ( 
124124          await  getStorage ( [ 'breakSeconds' ] ) 
125125        ) . breakSeconds 
126126        nextPhase  =  'break' 
127127      } 
128128      dailyPomodoros  =  increaseDailyPomodoro ( dailyPomodoros ) 
129129    }  else  { 
130-       reminingSeconds  =  await  ( 
130+       remainingSeconds  =  await  ( 
131131        await  getStorage ( [ 'pomodoroSeconds' ] ) 
132132      ) . pomodoroSeconds 
133133    } 
134134    const  todayTotalPomodoroCount  =  extractTodayPomodoroCount ( dailyPomodoros ) 
135135
136136    setStorage ( { 
137-       reminingSeconds , 
137+       remainingSeconds , 
138138      phase : nextPhase , 
139139      totalPomodoroCountsInSession, 
140140      isRunning : false , 
141141      dailyPomodoros, 
142142      isTimerStarted : false 
143143    } ) 
144-     await  updateSecondsOfBadge ( reminingSeconds ) 
144+     await  updateSecondsOfBadge ( remainingSeconds ) 
145145    await  updateColorOfBadge ( nextPhase ) 
146146
147147    if  ( isAutoExpire )  { 
@@ -188,9 +188,9 @@ const expire = async (
188188    setTickInterval ( false ) 
189189    // popup非表示時はここで止まってしまうため最後に実行する 
190190    await  runtime . sendMessage < Message > ( { 
191-       type : FromServiceWorkerMessgeType . EXPIRE , 
191+       type : FromServiceWorkerMessageType . EXPIRE , 
192192      data : { 
193-         secs : reminingSeconds , 
193+         secs : remainingSeconds , 
194194        phase : nextPhase , 
195195        todayTotalPomodoroCount, 
196196        totalPomodoroCountsInSession, 
0 commit comments