1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-10-19 09:22:00 +00:00

Add settings for controlling the error reporting system.

Fix issues with destroying rooms and users.
Fix the control center not being available on certain pages.
Fix the host menu appearing when you aren't logged in.
Clean up some old CSS.
This commit is contained in:
SirStendec 2018-04-11 20:48:02 -04:00
parent e773600a3e
commit 92917453a7
12 changed files with 272 additions and 106 deletions

View file

@ -103,8 +103,11 @@ export default class Following extends SiteModule {
const edgesOrNodes = followedLiveUsers.nodes || followedLiveUsers.edges;
for (let i = 0; i < edgesOrNodes.length; i++) {
const edge = edgesOrNodes[i];
const node = edge.node || edge;
const edge = edgesOrNodes[i],
node = edge.node || edge;
if ( ! node || ! node.stream )
continue;
const s = node.stream.viewersCount = new Number(node.stream.viewersCount || 0);
s.profileImageURL = node.profileImageURL;
@ -134,8 +137,11 @@ export default class Following extends SiteModule {
const edgesOrNodes = followedHosts.nodes || followedHosts.edges;
for (let i = 0; i < edgesOrNodes.length; i++) {
const edge = edgesOrNodes[i];
const node = edge.node || edge;
const edge = edgesOrNodes[i],
node = edge.node || edge;
if ( ! node || ! node.hosting || ! node.hosting.stream )
continue;
const s = node.hosting.stream.viewersCount = new Number(node.hosting.stream.viewersCount || 0);
s.profileImageURL = node.hosting.profileImageURL;

View file

@ -59,7 +59,8 @@ export default class HostButton extends Module {
disabled: () => this._host_updating || this._host_error,
click: data => {
if (data.channel) this.sendHostUnhostCommand(data.channel.login);
if ( data.channel )
this.sendHostUnhostCommand(data.channel.login);
},
popup: async (data, tip) => {
@ -78,20 +79,13 @@ export default class HostButton extends Module {
},
label: data => {
if (!this.settings.get('metadata.host-button')) {
return '';
}
const ffz_user = this.site.getUser();
const ffz_user = this.site.getUser(),
userLogin = ffz_user && ffz_user.login;
if ( ! this.settings.get('metadata.host-button') || ! ffz_user || ! data.channel || data.channel.login === ffz_user.login )
return;
if (data.channel && data.channel.login === userLogin) {
return '';
}
if (this._host_updating) {
if ( this._host_updating )
return 'Updating...';
}
return (this._last_hosted_channel && this.isChannelHosted(data.channel && data.channel.login))
? this.i18n.t('metadata.host.button.unhost', 'Unhost')

View file

@ -100,6 +100,8 @@ export default class MenuButton extends SiteModule {
cl.remove('loading');
}).catch(err => {
this.log.capture(err);
// TODO: Show a proper dialog and not an alert.
this.log.error('Error enabling main menu.', err);
alert('There was an error displaying the menu.'); // eslint-disable-line no-alert