-
-
Notifications
You must be signed in to change notification settings - Fork 832
Conversation
}, (err, response, body) => { | ||
if (err) { | ||
defer.reject(err); | ||
} else if (response.statusCode / 100 !== 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can 404 fall back to the widget's name, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only affects the "variable" component of the AppTile title, the widget's name will always be displayed in the AppTile menu bar.
The variable component of the widget name is not displayed if it is the same as the "widget name". Adding it in here would just be unnecessary duplication (unless I am missing something?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what this is here for now. I thought it was replacing the existing title, but it's just a hint next to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep :)
src/ScalarAuthClient.js
Outdated
getScalarPageTitle(url) { | ||
const defer = Promise.defer(); | ||
|
||
let scalarPageLookupUrl = SdkConfig.get().integrations_rest_url + '/api/widgets/title_lookup'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the URL preview endpoint from the media repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ftr this ends up being https://scalar-staging.riot.im/scalar/api/api/widgets/title_lookup (double api)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh... thanks for pointing that out @turt2live. I'm not really familiar with the media repo, though it looks like you're right, that would have been a simpler solution. It looks like this can be switched over easily at any point though.
I'll have a look in to the URL string duplication now (it's working fine in dev)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplication is because the string in the config.json
has the api
route defined in the REST endpoint.
Examples:
https://riot.im/develop/config.json
https://riot.im/app/config.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're absolutely right. Thanks for catching that one! (slightly screwy config. on my end to blame for that one, I think). Fixed now.
@ara4n This one should be good to go now. Can you please have a quick look? |
Matthew has LGTMed this IRL |
Use the new scalar page title API to get and display (custom) widget content page titles.