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 for collectibles duplicated in vertical display. #5255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion app/components-react/pages/BrowseOverlays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ export default function BrowseOverlays(p: {
}

const sourceSettings =
type === 'video' ? { looping: true, local_file: localFile } : { file: localFile };
type === 'video'
? { looping: true, local_file: localFile, display: 'horizontal' }
: { file: localFile, display: 'horizontal' };

return ScenesService.actions.return.createAndAddSource(
sceneId,
Expand Down
18 changes: 1 addition & 17 deletions app/services/scenes/scenes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,28 +460,12 @@ export class ScenesService extends StatefulService<IScenesState> {

const sceneItem = scene.createAndAddSource(sourceName, sourceType, settings);

const createVerticalNode = () => {
if (this.dualOutputService.views.hasSceneNodeMaps) {
this.dualOutputService.createPartnerNode(sceneItem);
/* For some reason dragging items after enabling dual output makes them
* duplicate, associate selection on switch to mitigate this issue
*/
this.selectionService.associateSelectionWithDisplay('vertical');
};

if (this.dualOutputService.state.dualOutputMode) {
createVerticalNode();
} else {
// Schedule vertical node to be created if the user toggles on dual output in the same session
this.dualOutputService.dualOutputModeChanged
.pipe(
// If we switch collections before we enable dual output drop it
// we don't wanna create nodes on inactive scene collections
takeUntil(this.sceneCollectionsService.collectionWillSwitch),
filter(gotEnabled => !!gotEnabled),
take(1),
tap(createVerticalNode),
)
.subscribe();
}

return sceneItem.sceneItemId;
Expand Down
Loading