@@ -8,6 +8,7 @@ import { apiRequestAuth } from '../utils/api-requests';
88import {
99 getEnterpriseAccountToken ,
1010 generateGitHubAPIUrl ,
11+ isEnterpriseHost ,
1112} from '../utils/helpers' ;
1213import { removeNotification } from '../utils/remove-notification' ;
1314import {
@@ -130,9 +131,9 @@ export const useNotifications = (colors: boolean): NotificationsState => {
130131 ) {
131132 return notification ;
132133 }
133- const isEnterprise =
134- accountNotifications . hostname !==
135- Constants . DEFAULT_AUTH_OPTIONS . hostname ;
134+ const isEnterprise = isEnterpriseHost (
135+ accountNotifications . hostname ,
136+ ) ;
136137 const token = isEnterprise
137138 ? getEnterpriseAccountToken (
138139 accountNotifications . hostname ,
@@ -192,7 +193,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
192193 async ( accounts , id , hostname ) => {
193194 setIsFetching ( true ) ;
194195
195- const isEnterprise = hostname !== Constants . DEFAULT_AUTH_OPTIONS . hostname ;
196+ const isEnterprise = isEnterpriseHost ( hostname ) ;
196197 const token = isEnterprise
197198 ? getEnterpriseAccountToken ( hostname , accounts . enterpriseAccounts )
198199 : accounts . token ;
@@ -225,7 +226,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
225226 async ( accounts , id , hostname ) => {
226227 setIsFetching ( true ) ;
227228
228- const isEnterprise = hostname !== Constants . DEFAULT_AUTH_OPTIONS . hostname ;
229+ const isEnterprise = isEnterpriseHost ( hostname ) ;
229230 const token = isEnterprise
230231 ? getEnterpriseAccountToken ( hostname , accounts . enterpriseAccounts )
231232 : accounts . token ;
@@ -258,7 +259,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
258259 async ( accounts , id , hostname ) => {
259260 setIsFetching ( true ) ;
260261
261- const isEnterprise = hostname !== Constants . DEFAULT_AUTH_OPTIONS . hostname ;
262+ const isEnterprise = isEnterpriseHost ( hostname ) ;
262263 const token = isEnterprise
263264 ? getEnterpriseAccountToken ( hostname , accounts . enterpriseAccounts )
264265 : accounts . token ;
@@ -284,7 +285,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
284285 async ( accounts , repoSlug , hostname ) => {
285286 setIsFetching ( true ) ;
286287
287- const isEnterprise = hostname !== Constants . DEFAULT_AUTH_OPTIONS . hostname ;
288+ const isEnterprise = isEnterpriseHost ( hostname ) ;
288289 const token = isEnterprise
289290 ? getEnterpriseAccountToken ( hostname , accounts . enterpriseAccounts )
290291 : accounts . token ;
0 commit comments