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: ->
|
||||
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 #################################################################################
|
||||
|
||||
findName: (slug, options={})->
|
||||
@@ -176,6 +185,10 @@ module.exports = class ModPack extends BaseModel
|
||||
return true unless mods.length > 0
|
||||
|
||||
for mod in mods
|
||||
if mod.isError
|
||||
@removeMod mod
|
||||
continue
|
||||
|
||||
modVersions = mod.getAllModVersions()
|
||||
return true unless modVersions.length > 0
|
||||
continue if mod.activeVersion is Mod.Version.None
|
||||
|
||||
@@ -28,6 +28,7 @@ module.exports = class BrowsePageController extends PageController
|
||||
@_tileControllers = []
|
||||
|
||||
@_client.on c.event.change, => @tryRefresh()
|
||||
@_modPack.on c.event.change, => @tryRefresh()
|
||||
|
||||
# Property Methods #############################################################################
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ module.exports = class AdsenseController
|
||||
maxAds = c.adsense[adType].slotIds.length - @_adsPlaced
|
||||
return if maxAds is 0
|
||||
|
||||
logger.verbose => "Looking to place #{maxAds} more #{adType} ads..."
|
||||
|
||||
if adType is 'skyscraper'
|
||||
placedNewAd = @_createSkyscraperPositions()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user