Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(widgets): infinite load on Media Share and Emote Wall #5273

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components-react/widgets/common/useWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class WidgetModule<TWidgetState extends IWidgetState = IWidgetState> {
]);

this.setStaticConfig(staticConfig);
if (staticConfig) {
if (staticConfig?.data?.custom_code) {
// I miss lenses
const makeLenses = (type: 'html' | 'css' | 'js') => {
const prop = `custom_${type}`;
Expand Down
1 change: 1 addition & 0 deletions app/components/widgets/WidgetSettings.vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default class WidgetSettings<
this.requestState = 'success';
this.afterFetch();
} catch (e: unknown) {
console.error('Something failed on widget settings fetch', e);
this.requestState = 'fail';
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/services/widgets/settings/emote-wall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class EmoteWallService extends WidgetSettingsService<IEmoteWallData> {
dataFetchUrl: `https://${this.getHost()}/api/v5/slobs/widget/emote-wall`,
settingsSaveUrl: `https://${this.getHost()}/api/v5/slobs/widget/emote-wall`,
settingsUpdateEvent: 'emoteWallSettingsUpdate',
customCodeAllowed: true,
customFieldsAllowed: true,
customCodeAllowed: false,
customFieldsAllowed: false,
hasTestButtons: true,
};
}
Expand Down
2 changes: 1 addition & 1 deletion app/services/widgets/settings/widget-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export abstract class WidgetSettingsService<TWidgetData extends IWidgetData>

// TODO: type
const { staticConfig }: any = this.state;
if (staticConfig) {
if (staticConfig?.data?.custom_code) {
// These seem only used to restore defaults
data.custom_defaults = staticConfig.data?.custom_code;
// If we have a default for custom code and the fields are empty in the
Expand Down
4 changes: 2 additions & 2 deletions app/services/widgets/widgets-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ export function getWidgetsConfig(
dataFetchUrl: `https://${host}/api/v5/slobs/widget/emote-wall`,
settingsSaveUrl: `https://${host}/api/v5/slobs/widget/emote-wall`,
settingsUpdateEvent: 'emoteWallSettingsUpdate',
customCodeAllowed: true,
customFieldsAllowed: true,
customCodeAllowed: false,
customFieldsAllowed: false,
},

// TODO:
Expand Down
Loading