(email: string, key: string)
| 647 | } |
| 648 | |
| 649 | private static async startActivation(email: string, key: string) { |
| 650 | const delay = 2000 + Math.round(Math.random() * 2000); |
| 651 | const checkEmail = (email: string) => email && email.trim().includes('@'); |
| 652 | const checkKey = (key: string) => key.replaceAll('-', '').length === 25 && key.toLocaleLowerCase().startsWith('dr') && key.replaceAll('-', '').match(/^[0-9a-z]{25}$/i); |
| 653 | setTimeout(async () => { |
| 654 | await writeLocalStorage({activationEmail: email, activationKey: key}); |
| 655 | if (checkEmail(email) && checkKey(key)) { |
| 656 | await UIHighlights.hideHighlights(['anniversary']); |
| 657 | if (__PLUS__) { |
| 658 | await Extension.changeSettings({previewNewestDesign: true}); |
| 659 | } |
| 660 | } |
| 661 | Extension.reportChanges(); |
| 662 | }, delay); |
| 663 | } |
| 664 | |
| 665 | private static async resetActivation() { |
| 666 | await removeLocalStorage(['activationEmail', 'activationKey']); |
nothing calls this directly
no test coverage detected