Skip to content

Commit

Permalink
fix retry logic (stream-labs#3184)
Browse files Browse the repository at this point in the history
  • Loading branch information
holiber authored Dec 16, 2020
1 parent 686b7e8 commit 114f75d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/components/windows/go-live/GoLiveError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ export default class GoLiveError extends TsxComponent<{}> {
message={$t('updateStreamSettingsError')}
scopedSlots={{
tryAgainLink: (text: string) => (
<a class={styles.link} onClick={() => this.streamingService.actions.goLive()}>
<a
class={styles.link}
onClick={() => this.streamingService.actions.goLive(this.view.info.settings)}
>
{{ text }}
</a>
),
Expand Down
1 change: 1 addition & 0 deletions app/services/streaming/streaming-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface IStreamInfo {
| 'live'; // stream has been successfully started
error: IStreamError | null;
warning: 'YT_AUTO_START_IS_DISABLED' | '';
settings: IGoLiveSettings | null; // settings for the current attempt of going live
checklist: {
applyOptimizedSettings: TGoLiveChecklistItemState;
twitch: TGoLiveChecklistItemState;
Expand Down
9 changes: 9 additions & 0 deletions app/services/streaming/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class StreamingService extends StatefulService<IStreamingServiceState>
replayBufferStatusTime: new Date().toISOString(),
selectiveRecording: false,
info: {
settings: null,
lifecycle: 'empty',
error: null,
warning: '',
Expand Down Expand Up @@ -232,6 +233,9 @@ export class StreamingService extends StatefulService<IStreamingServiceState>
// save enabled platforms to reuse setting with the next app start
this.streamSettingsService.setSettings({ goLiveSettings: settings });

// save current settings in store so we can re-use them if something will go wrong
this.SET_GO_LIVE_SETTINGS(settings);

// show the GoLive checklist
this.UPDATE_STREAM_INFO({ lifecycle: 'runChecklist' });

Expand Down Expand Up @@ -1082,4 +1086,9 @@ export class StreamingService extends StatefulService<IStreamingServiceState>
private SET_WARNING(warningType: 'YT_AUTO_START_IS_DISABLED') {
this.state.info.warning = warningType;
}

@mutation()
private SET_GO_LIVE_SETTINGS(settings: IGoLiveSettings) {
this.state.info.settings = settings;
}
}

0 comments on commit 114f75d

Please sign in to comment.