Skip to content

Commit

Permalink
7TV Emotes 1.4.17
Browse files Browse the repository at this point in the history
* Fixed: 7TV emotes not loading properly for some users in OBS due to some improperly cached data
  • Loading branch information
Lordmau5 committed Dec 22, 2023
1 parent 6f049f9 commit 371c3a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/7tv-emotes/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main",
"clips"
],
"version": "1.4.16",
"version": "1.4.17",
"short_name": "7TV",
"name": "7TV Emotes",
"author": "Melonify",
Expand All @@ -14,5 +14,5 @@
"website": "https://7tv.app",
"settings": "add_ons.7tv_emotes",
"created": "2021-07-12T23:18:04.000Z",
"updated": "2023-12-15T16:15:39.912Z"
"updated": "2023-12-22T00:31:14.154Z"
}
13 changes: 11 additions & 2 deletions src/7tv-emotes/modules/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ export default class API extends FrankerFaceZ.utilities.module.Module {
this.clientVersion = this.parent.manifest.version;
}

makeRequest(route, options = {}) {
makeRequest(route, options = {}, skip_cache = false) {
const headers = new Headers(options && options.headers || {});

headers.set('X-SevenTV-Platform', this.clientPlatform);
headers.set('X-SevenTV-Version', this.clientVersion);

return fetch(`${this.apiBaseURI}/${route}`, {...options, headers})
const request = fetch(`${this.apiBaseURI}/${route}`, {
cache: skip_cache ? 'reload' : 'default',
...options,
headers
});

if ( ! skip_cache )
return request.catch(() => this.makeRequest(route, options, true));

return request;
}

async requestJSON(route, options = {}) {
Expand Down
7 changes: 7 additions & 0 deletions src/7tv-emotes/modules/emotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ export default class Emotes extends FrankerFaceZ.utilities.module.Module {
});

this.setToChannelMap = new Map();

this.on('chat:reload-data', flags => {
if (!flags || flags.emotes) {
this.updateGlobalEmotes();
this.updateChannelSets();
}
});
}

onEnable() {
Expand Down

0 comments on commit 371c3a2

Please sign in to comment.