Allow option to remain connected on registration failure.

This commit is contained in:
Matthew Stratford 2021-03-02 00:45:49 +00:00
parent 6412269b0f
commit abace4e42b
3 changed files with 31 additions and 1 deletions

View file

@ -144,7 +144,16 @@ export const registerForShow = (): AppThunk => async (dispatch, getState) => {
})
);
if (streamer) {
await streamer.stop("ApiException " + e.message);
// We're connected,
var remain_connected = getState().settings.allowStreamingOnReject;
if (remain_connected) {
console.log(
"StateServer refused registration. Due to setting, staying connected.",
e
);
} else {
await streamer.stop("ApiException " + e.message);
}
}
} else {
// let raygun handle it

View file

@ -305,6 +305,25 @@ export function AdvancedTab() {
/>
<label className="form-check-label">Enable recording</label>
</div>
<div className="form-check">
<input
className="form-check-input"
type="checkbox"
checked={settings.allowStreamingOnReject}
onChange={(e) =>
dispatch(
changeSetting({
key: "allowStreamingOnReject",
val: e.target.checked,
})
)
}
/>
<label>
Allow connection persistance for troubleshooting. (Don't enable unless
requested to.)
</label>
</div>
</>
);
}

View file

@ -3,6 +3,7 @@ import { INTERNAL_OUTPUT_ID, PLAYER_COUNT } from "../mixer/audio";
interface Settings {
showDebugInfo: boolean;
allowStreamingOnReject: boolean;
enableRecording: boolean;
tracklist: "always" | "while_live" | "never";
doTheNews: "always" | "while_live" | "never";
@ -18,6 +19,7 @@ const settingsState = createSlice({
name: "settings",
initialState: {
showDebugInfo: false,
allowStreamingOnReject: false,
enableRecording: false,
tracklist: "while_live",
doTheNews: "while_live",