File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,18 @@ if (/register(\/.*)?$/.test(window.location.href)) {
20
20
} ) ;
21
21
22
22
socket . on ( "register" , function ( data ) {
23
+ const element = document . createElement ( "div" ) ;
24
+ if ( document . getElementById ( "failure-notif" ) ) {
25
+ document . getElementById ( "auth" ) . removeChild ( document . getElementById ( "failure-notif" ) ) ;
26
+ }
23
27
if ( [ 400 , 500 ] . indexOf ( data . status ) > - 1 ) {
24
- document . getElementById ( "auth" ) . innerHTML = message . replace ( "<type>" , "failure" ) . replace ( "<message>" , data . message ) + document . getElementById ( "auth" ) . innerHTML ;
28
+ element . id = "failure-notif" ;
29
+ element . innerHTML = data . message ;
30
+ document . getElementById ( "auth" ) . prepend ( element ) ;
25
31
} else {
32
+ if ( document . getElementById ( "success-notif" ) ) {
33
+ document . getElementById ( "auth" ) . removeChild ( document . getElementById ( "success-notif" ) ) ;
34
+ }
26
35
document . getElementById ( "auth" ) . innerHTML = message . replace ( "<type>" , "success" ) . replace ( "<message>" , data . message ) + document . getElementById ( "auth" ) . innerHTML ;
27
36
}
28
37
} ) ;
You can’t perform that action at this time.
0 commit comments