@@ -60,7 +60,6 @@ type PopupKey =
6060 | "resetProgressCustomTextLong"
6161 | "updateCustomTheme"
6262 | "deleteCustomTheme"
63- | "forgotPassword"
6463 | "devGenerateData" ;
6564
6665const list : Record < PopupKey , SimpleModal | undefined > = {
@@ -86,7 +85,6 @@ const list: Record<PopupKey, SimpleModal | undefined> = {
8685 resetProgressCustomTextLong : undefined ,
8786 updateCustomTheme : undefined ,
8887 deleteCustomTheme : undefined ,
89- forgotPassword : undefined ,
9088 devGenerateData : undefined ,
9189} ;
9290
@@ -1221,46 +1219,6 @@ list.deleteCustomTheme = new SimpleModal({
12211219 } ,
12221220} ) ;
12231221
1224- list . forgotPassword = new SimpleModal ( {
1225- id : "forgotPassword" ,
1226- title : "Forgot password" ,
1227- inputs : [
1228- {
1229- type : "text" ,
1230- placeholder : "email" ,
1231- initVal : "" ,
1232- } ,
1233- ] ,
1234- buttonText : "send" ,
1235- execFn : async ( _thisPopup , email ) : Promise < ExecReturn > => {
1236- const result = await Ape . users . forgotPasswordEmail ( {
1237- body : { email : email . trim ( ) } ,
1238- } ) ;
1239- if ( result . status !== 200 ) {
1240- return {
1241- status : - 1 ,
1242- message : "Failed to send password reset email: " + result . body . message ,
1243- } ;
1244- }
1245-
1246- return {
1247- status : 1 ,
1248- message : result . body . message ,
1249- notificationOptions : {
1250- duration : 8 ,
1251- } ,
1252- } ;
1253- } ,
1254- beforeInitFn : ( thisPopup ) : void => {
1255- const inputValue = $ (
1256- `.pageLogin .login input[name="current-email"]`
1257- ) . val ( ) as string ;
1258- if ( inputValue ) {
1259- ( thisPopup . inputs [ 0 ] as TextInput ) . initVal = inputValue ;
1260- }
1261- } ,
1262- } ) ;
1263-
12641222list . devGenerateData = new SimpleModal ( {
12651223 id : "devGenerateData" ,
12661224 title : "Generate data" ,
@@ -1365,10 +1323,6 @@ export function showPopup(
13651323}
13661324
13671325//todo: move these event handlers to their respective files (either global event files or popup files)
1368- $ ( ".pageLogin #forgotPasswordButton" ) . on ( "click" , ( ) => {
1369- showPopup ( "forgotPassword" ) ;
1370- } ) ;
1371-
13721326$ ( ".pageAccountSettings" ) . on ( "click" , "#unlinkDiscordButton" , ( ) => {
13731327 showPopup ( "unlinkDiscord" ) ;
13741328} ) ;
0 commit comments