1- import { EffectType } from "../../../../../types/effects " ;
1+ import type { EffectType , BackendCommunicator } from "../../../../../types" ;
22import { setCurrentSceneCollection } from "../obs-remote" ;
33
44export const ChangeSceneCollectionEffectType : EffectType < {
55 sceneCollectionName : string ;
6+ custom : boolean ;
67} > = {
78 definition : {
89 id : "ebiggz:obs-change-scene-collection" ,
@@ -31,30 +32,29 @@ export const ChangeSceneCollectionEffectType: EffectType<{
3132 </div>
3233 </eos-container>
3334 ` ,
34- optionsController : ( $scope : any , backendCommunicator : any , $q : any ) => {
35+ optionsController : ( $scope , backendCommunicator : BackendCommunicator ) => {
3536 $scope . isObsConfigured = false ;
3637
3738 $scope . sceneCollections = [ ] ;
3839
39- $scope . customCollection = { name : "Set Custom" , custom : true } ;
40+ $scope . customCollection = { name : "Set Custom" , custom : true } ;
4041
41- $scope . selectSceneCollection = ( sceneCollection : { name : string , custom : boolean } ) => {
42+ $scope . selectSceneCollection = ( sceneCollection : { name : string , custom : boolean } ) => {
4243 $scope . effect . custom = sceneCollection . custom ;
4344 if ( ! sceneCollection . custom ) {
4445 $scope . effect . sceneCollectionName = sceneCollection . name ;
4546 }
4647 } ;
4748
48- $scope . getSceneCollections = ( ) => {
49- $scope . isObsConfigured = backendCommunicator . fireEventSync ( "obs-is-configured" ) ;
49+ $scope . getSceneCollections = async ( ) => {
50+ $scope . isObsConfigured = await backendCommunicator . fireEventAsync ( "obs-is-configured" ) ;
5051
51- $q . when (
52- backendCommunicator . fireEventAsync ( "obs-get-scene-collection-list" )
53- ) . then ( ( sceneCollections : string [ ] ) => {
52+ try {
53+ const sceneCollections : string [ ] = await backendCommunicator . fireEventAsync ( "obs-get-scene-collection-list" ) ;
5454 $scope . sceneCollections = [ ] ;
5555 if ( sceneCollections != null ) {
5656 sceneCollections . forEach ( ( sceneCollection ) => {
57- $scope . sceneCollections . push ( { name : sceneCollection , custom : false } ) ;
57+ $scope . sceneCollections . push ( { name : sceneCollection , custom : false } ) ;
5858 } ) ;
5959 }
6060 $scope . sceneCollections . push ( $scope . customCollection ) ;
@@ -64,8 +64,9 @@ export const ChangeSceneCollectionEffectType: EffectType<{
6464 $scope . selected = $scope . sceneCollections . find ( collection =>
6565 collection . name === $scope . effect . sceneCollectionName ) ;
6666 }
67- } ) ;
67+ } catch { }
6868 } ;
69+
6970 $scope . getSceneCollections ( ) ;
7071 } ,
7172 optionsValidator : ( effect ) => {
0 commit comments