links: fix direct loading of link entry
If you go directly to a link's page, it will never load, because we
don't look for 'link-update' in our data, post-global store. This checks
properly.
@@ -44,8 +44,8 @@ export default class LinksApi extends BaseApi<StoreState> {
this.fetchLink(
endpoint,
(res) => {
- if (res.data.submission) {
- callback(res.data.submission);
+ if (res.data?.['link-update']?.submission) {
+ callback(res.data?.['link-update']?.submission);
} else {
console.error('unexpected submission response', res);
}
