Skip to content

Commit

Permalink
Save legacy settings on shutdown. (stream-labs#4564)
Browse files Browse the repository at this point in the history
* Save legacy settings on shutdown.

* Save video setting to legacy settings on save.

* Use context object for legacy settings.
  • Loading branch information
michelinewu authored May 4, 2023
1 parent 8b6369b commit 12ca645
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/services/settings-v2/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export class VideoSettingsService extends StatefulService<IVideoSetting> {
@debounce(200)
updateObsSettings(display: TDisplayType = 'horizontal') {
this.contexts[display].video = this.state[display];
this.contexts[display].legacySettings = this.state[display];
}

setVideoSetting(key: string, value: unknown, display: TDisplayType = 'horizontal') {
Expand All @@ -220,6 +221,10 @@ export class VideoSettingsService extends StatefulService<IVideoSetting> {
shutdown() {
displays.forEach(display => {
if (this.contexts[display]) {
// save settings as legacy settings
this.contexts[display].legacySettings = this.state[display];

// destroy context
this.contexts[display].destroy();
this.contexts[display] = null as obs.IVideo;
this.DESTROY_VIDEO_CONTEXT(display);
Expand Down

0 comments on commit 12ca645

Please sign in to comment.