mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Merge pull request #1206 from coralproject/feature/infer-asset-url
Fix logic to generate asset_url even if the asset_id is provided
This commit is contained in:
@@ -70,10 +70,9 @@ export class Talk {
|
|||||||
// Extract the asset url.
|
// Extract the asset url.
|
||||||
if (opts.asset_url) {
|
if (opts.asset_url) {
|
||||||
query.asset_url = opts.asset_url;
|
query.asset_url = opts.asset_url;
|
||||||
} else if (!opts.asset_id) {
|
} else {
|
||||||
|
|
||||||
// The asset url was not provided and the asset id was also not provided,
|
// The asset url was not provided so we need to infer the asset url from // details on the page.
|
||||||
// we need to infer the asset url from details on the page.
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
query.asset_url = document.querySelector('link[rel="canonical"]').href;
|
query.asset_url = document.querySelector('link[rel="canonical"]').href;
|
||||||
|
|||||||
Reference in New Issue
Block a user