@@ -120,6 +120,9 @@ interface IConnectedProps extends IModProps {
120
120
downloadPath : string ;
121
121
showDropzone : boolean ;
122
122
autoInstall : boolean ;
123
+ // some mod actions are not allowed while installing dependencies/collections
124
+ // e.g. combining a mod with other patch mods while the collection is still installing.
125
+ suppressModActions : boolean ;
123
126
}
124
127
125
128
interface IActionProps {
@@ -1473,19 +1476,27 @@ class ModList extends ComponentEx<IProps, IComponentState> {
1473
1476
}
1474
1477
1475
1478
private canBeCombined = ( modIds : string [ ] ) => {
1476
- const { t, mods } = this . props ;
1479
+ const { t, mods, suppressModActions } = this . props ;
1477
1480
1478
1481
const notInstalled = modIds . find ( modId => mods [ modId ] === undefined ) ;
1479
1482
if ( notInstalled !== undefined ) {
1480
1483
return t ( 'You can only combine installed mods' ) ;
1481
1484
}
1485
+
1486
+ if ( suppressModActions ) {
1487
+ return t ( 'Try again after installing dependencies' ) ;
1488
+ }
1489
+
1482
1490
return true ;
1483
1491
}
1484
1492
1485
1493
private combine = ( modIds : string [ ] ) => {
1486
- const { gameMode } = this . props ;
1494
+ const { gameMode, suppressModActions } = this . props ;
1487
1495
const { api } = this . context ;
1488
-
1496
+ if ( suppressModActions ) {
1497
+ api . showErrorNotification ( 'Try again after installing dependencies' , 'Mod actions are currently disabled' , { allowReport : false } ) ;
1498
+ return ;
1499
+ }
1489
1500
return combineMods ( api , gameMode , modIds ) ;
1490
1501
}
1491
1502
@@ -1530,10 +1541,20 @@ class ModList extends ComponentEx<IProps, IComponentState> {
1530
1541
1531
1542
const empty = { } ;
1532
1543
1544
+ const shouldSuppressModActions = ( state : IState ) : boolean => {
1545
+ const suppressOnActivities = [ 'conflicts' , 'installing_dependencies' , 'deployment' , 'purging' ] ;
1546
+ const isActivityRunning = ( activity : string ) =>
1547
+ getSafe ( state , [ 'session' , 'base' , 'activity' , 'mods' ] , [ ] ) . includes ( activity ) // purge/deploy
1548
+ || getSafe ( state , [ 'session' , 'base' , 'activity' , activity ] , [ ] ) . length > 0 ; // installing_dependencies
1549
+ const suppressingActivities = suppressOnActivities . filter ( activity => isActivityRunning ( activity ) ) ;
1550
+ const suppressing = suppressingActivities . length > 0 ;
1551
+ return suppressing ;
1552
+ }
1553
+
1533
1554
function mapStateToProps ( state : IState ) : IConnectedProps {
1534
1555
const profile = selectors . activeProfile ( state ) ;
1535
1556
const gameMode = selectors . activeGameId ( state ) ;
1536
-
1557
+ const suppressModActions = shouldSuppressModActions ( state ) ;
1537
1558
return {
1538
1559
mods : getSafe ( state , [ 'persistent' , 'mods' , gameMode ] , empty ) ,
1539
1560
modState : getSafe ( profile , [ 'modState' ] , empty ) ,
@@ -1545,6 +1566,7 @@ function mapStateToProps(state: IState): IConnectedProps {
1545
1566
downloadPath : selectors . downloadPath ( state ) ,
1546
1567
showDropzone : state . settings . mods . showDropzone ,
1547
1568
autoInstall : state . settings . automation . install ,
1569
+ suppressModActions,
1548
1570
} ;
1549
1571
}
1550
1572
0 commit comments