mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-08 07:10:54 +00:00
Attempt at fixing caching issues with Apollo for the stream up-time display, as well as adding a re-usable function for grabbing data from Apollo.
This commit is contained in:
parent
863eafd32f
commit
d2b4dcbce4
2 changed files with 62 additions and 15 deletions
|
@ -60,20 +60,8 @@ export default class Metadata extends Module {
|
|||
|
||||
setup() {
|
||||
const socket = this.resolve('socket'),
|
||||
query = this.resolve('site.apollo').getQuery('ChannelPage_ChannelInfoBar_User'),
|
||||
result = query && query.lastResult,
|
||||
created_at = result && get('data.user.stream.createdAt', result);
|
||||
|
||||
if ( ! query )
|
||||
return {};
|
||||
|
||||
if ( created_at === undefined && ! query._ffz_refetched ) {
|
||||
query._ffz_refetched = true;
|
||||
if ( result )
|
||||
result.stale = true;
|
||||
query.refetch();
|
||||
return {};
|
||||
}
|
||||
apollo = this.resolve('site.apollo'),
|
||||
created_at = apollo.getFromQuery('ChannelPage_ChannelInfoBar_User', 'data.user.stream.createdAt');
|
||||
|
||||
if ( ! created_at )
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue