Don't hang the site if a mod doesn't load
This commit is contained in:
@@ -130,6 +130,15 @@ module.exports = class ModPack extends BaseModel
|
|||||||
getAllMods: ->
|
getAllMods: ->
|
||||||
return @_mods[..]
|
return @_mods[..]
|
||||||
|
|
||||||
|
removeMod: (mod)->
|
||||||
|
index = @_mods.indexOf mod
|
||||||
|
return unless index >= 0
|
||||||
|
|
||||||
|
@_mods.splice index, 1
|
||||||
|
|
||||||
|
@trigger c.event.remove, this, mod.slug
|
||||||
|
@trigger c.event.change, this
|
||||||
|
|
||||||
# Name Methods #################################################################################
|
# Name Methods #################################################################################
|
||||||
|
|
||||||
findName: (slug, options={})->
|
findName: (slug, options={})->
|
||||||
@@ -176,6 +185,10 @@ module.exports = class ModPack extends BaseModel
|
|||||||
return true unless mods.length > 0
|
return true unless mods.length > 0
|
||||||
|
|
||||||
for mod in mods
|
for mod in mods
|
||||||
|
if mod.isError
|
||||||
|
@removeMod mod
|
||||||
|
continue
|
||||||
|
|
||||||
modVersions = mod.getAllModVersions()
|
modVersions = mod.getAllModVersions()
|
||||||
return true unless modVersions.length > 0
|
return true unless modVersions.length > 0
|
||||||
continue if mod.activeVersion is Mod.Version.None
|
continue if mod.activeVersion is Mod.Version.None
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ module.exports = class BrowsePageController extends PageController
|
|||||||
@_tileControllers = []
|
@_tileControllers = []
|
||||||
|
|
||||||
@_client.on c.event.change, => @tryRefresh()
|
@_client.on c.event.change, => @tryRefresh()
|
||||||
|
@_modPack.on c.event.change, => @tryRefresh()
|
||||||
|
|
||||||
# Property Methods #############################################################################
|
# Property Methods #############################################################################
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ module.exports = class AdsenseController
|
|||||||
maxAds = c.adsense[adType].slotIds.length - @_adsPlaced
|
maxAds = c.adsense[adType].slotIds.length - @_adsPlaced
|
||||||
return if maxAds is 0
|
return if maxAds is 0
|
||||||
|
|
||||||
logger.verbose => "Looking to place #{maxAds} more #{adType} ads..."
|
|
||||||
|
|
||||||
if adType is 'skyscraper'
|
if adType is 'skyscraper'
|
||||||
placedNewAd = @_createSkyscraperPositions()
|
placedNewAd = @_createSkyscraperPositions()
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user