esse-dev / akita

A browser extension that gives you insight into your engagement with Web Monetization.
Other
24 stars 3 forks source link

Move class fields into constructor to avoid Firefox add-on errors #124

Closed sharon-wang closed 3 years ago

sharon-wang commented 3 years ago

Defining class fields is invalid in older versions of JavaScript, which Firefox seems to test for in its add-on scanning. Moving the fields into the class's constructor avoids these errors. This resolves "Errors: Declaring class properties outside of the constructor." of https://github.com/esse-dev/akita/issues/65.

Some minor refactoring to the constructors and fromObject() was done for better consistency.

Testing: