@@ -86,6 +86,27 @@ export class TwitchBotConfigComponent implements OnInit, OnDestroy {
86
86
this . auth . validateToken ( oauth . AccessToken ) . subscribe ( {
87
87
next : _ => {
88
88
this . auth . setToken ( oauth ) ;
89
+
90
+ // Check if the bot account is modded. If it isn't, we can offer to mod it.
91
+ this . twitchBotApi . getIsMod ( ) . subscribe ( {
92
+ next : response => {
93
+ this . botIsMod = response . isMod ;
94
+ } ,
95
+ error : err => {
96
+ this . botIsMod = false ;
97
+ this . error = 'Unable to determine if nullinside is a mod in your channel' ;
98
+ console . log ( err ) ;
99
+ }
100
+ } ) ;
101
+
102
+ // Get the person's existing configuration.
103
+ this . twitchBotApi . getConfig ( ) . subscribe ( {
104
+ next : response => {
105
+ this . botEnabled = response . isEnabled ;
106
+ this . banKnownBots = response . banKnownBots ;
107
+ } ,
108
+ error : err => console . error ( err )
109
+ } ) ;
89
110
} ,
90
111
error : ( _ : HttpErrorResponse ) => {
91
112
this . onLoginFailed ( ) ;
@@ -97,27 +118,6 @@ export class TwitchBotConfigComponent implements OnInit, OnDestroy {
97
118
// make this unnecessary.
98
119
const url = this . router . createUrlTree ( [ ] , { relativeTo : this . route } ) . toString ( ) ;
99
120
this . location . go ( url ) ;
100
-
101
- // Check if the bot account is modded. If it isn't, we can offer to mod it.
102
- this . twitchBotApi . getIsMod ( ) . subscribe ( {
103
- next : response => {
104
- this . botIsMod = response . isMod ;
105
- } ,
106
- error : err => {
107
- this . botIsMod = false ;
108
- this . error = 'Unable to determine if nullinside is a mod in your channel' ;
109
- console . log ( err ) ;
110
- }
111
- } ) ;
112
-
113
- // Get the person's existing configuration.
114
- this . twitchBotApi . getConfig ( ) . subscribe ( {
115
- next : response => {
116
- this . botEnabled = response . isEnabled ;
117
- this . banKnownBots = response . banKnownBots ;
118
- } ,
119
- error : err => console . error ( err )
120
- } ) ;
121
121
} ,
122
122
error : ( _ : HttpErrorResponse ) => {
123
123
this . onLoginFailed ( ) ;
0 commit comments