Skip to content

Commit

Permalink
Fix replace command for IGTV path (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
dybdeskarphet committed May 13, 2022
1 parent 6a75279 commit 48fc4a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets/javascripts/helpers/instagram.js
Expand Up @@ -79,7 +79,7 @@ function redirect(url, type, initiator) {
if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1]))
return `${randomInstance}${url.pathname}${url.search}`;
if (url.pathname.startsWith("/reel") || url.pathname.startsWith("/tv"))
return `${randomInstance}/p${url.pathname.replace('/reel', '')}${url.search}`;
return `${randomInstance}/p${url.pathname.replace(/\/reel|\/tv/i, '')}${url.search}`;
else
return `${randomInstance}/u${url.pathname}${url.search}`; // Likely a user profile, redirect to '/u/...'
}
Expand Down

0 comments on commit 48fc4a2

Please sign in to comment.