lbry-desktop/web
infinite-persistence 15bd26399f Handle case where ad-cleanup fails
## Issue
Double ads on screen

## Reproduce
- Pre re-design:
    - Change "Only Language" from tne locale nag.
- Post re-design:
    - Follow a bunch of channels with active livestreams. The homepage ad will show 2 ads stack on each other, with second one invisible.

Both should be equivalent, just different UI/style.

## Analysis
In both cases, it is due to `removeIfExists` failing to remove the element if the ad script hasn't run yet.

This can happen when the component is re-mounted immediately after the ad script was added. When the effect-cleanup runs, the script have not started or is running halfway.

Aside: The need to run `removeIfExists` further strengthens my hunch that the script is meant to live throughout the lifetime of the app, with it populating the given div as we navigate. But just my guess.

## Approach
Clean up before adding the script as well. This covers any missed elements from the previous cleanup.

The drawback is that this approach assumes there will only be 1 ad per page, but that's pretty much the case with the existing `removeIfExists` approach.
2022-03-09 08:47:13 -05:00
..
component Handle case where ad-cleanup fails 2022-03-09 08:47:13 -05:00
effects [oEmbed] some changes and fixes (#392) 2021-12-01 10:36:52 -05:00
middleware Fix logic 2022-03-03 10:23:40 -05:00
page Misc updates 2021-11-29 20:32:39 -05:00
setup tus: try longer retry delays to maybe avoid lockups (#1012) 2022-03-02 11:03:49 -05:00
src Update CORS for homepage api so localhost works 2022-03-03 21:22:30 -05:00
static/pwa MAKE ODYSEE EVEN MORE BEAUTIFUL (#539) 2022-02-11 13:50:55 -05:00
stubs rename lbrytv to web 2020-05-25 17:21:02 -04:00
bundle-id.js fix uuid import with new version 2020-10-02 14:36:22 -04:00
index.js MAKE ODYSEE EVEN MORE BEAUTIFUL (#539) 2022-02-11 13:50:55 -05:00
lbry.js Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
package.json More cleanup 2022-01-31 11:39:03 -05:00
webpack.config.js i18n: restore ability to retrieve new i18n strings 2022-01-03 10:36:12 +08:00
webpack.sw.config.js Browser push notifications (#133) 2021-10-27 10:38:10 -04:00
yarn.lock Bump url-parse from 1.5.3 to 1.5.7 in /web (#926) 2022-02-19 14:40:32 -05:00